add lisp packages
This commit is contained in:
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/blob.js
generated
vendored
Normal file
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/blob.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function responseBlob(response) {
|
||||
if (!response.ok) throw new Error(response.status + " " + response.statusText);
|
||||
return response.blob();
|
||||
}
|
||||
|
||||
export default function(input, init) {
|
||||
return fetch(input, init).then(responseBlob);
|
||||
}
|
||||
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/buffer.js
generated
vendored
Normal file
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/buffer.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function responseArrayBuffer(response) {
|
||||
if (!response.ok) throw new Error(response.status + " " + response.statusText);
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
|
||||
export default function(input, init) {
|
||||
return fetch(input, init).then(responseArrayBuffer);
|
||||
}
|
||||
22
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/dsv.js
generated
vendored
Normal file
22
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/dsv.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import {csvParse, dsvFormat, tsvParse} from "d3-dsv";
|
||||
import text from "./text";
|
||||
|
||||
function dsvParse(parse) {
|
||||
return function(input, init, row) {
|
||||
if (arguments.length === 2 && typeof init === "function") row = init, init = undefined;
|
||||
return text(input, init).then(function(response) {
|
||||
return parse(response, row);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default function dsv(delimiter, input, init, row) {
|
||||
if (arguments.length === 3 && typeof init === "function") row = init, init = undefined;
|
||||
var format = dsvFormat(delimiter);
|
||||
return text(input, init).then(function(response) {
|
||||
return format.parse(response, row);
|
||||
});
|
||||
}
|
||||
|
||||
export var csv = dsvParse(csvParse);
|
||||
export var tsv = dsvParse(tsvParse);
|
||||
9
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/image.js
generated
vendored
Normal file
9
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/image.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function(input, init) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var image = new Image;
|
||||
for (var key in init) image[key] = init[key];
|
||||
image.onerror = reject;
|
||||
image.onload = function() { resolve(image); };
|
||||
image.src = input;
|
||||
});
|
||||
}
|
||||
7
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/index.js
generated
vendored
Normal file
7
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export {default as blob} from "./blob";
|
||||
export {default as buffer} from "./buffer";
|
||||
export {default as dsv, csv, tsv} from "./dsv";
|
||||
export {default as image} from "./image";
|
||||
export {default as json} from "./json";
|
||||
export {default as text} from "./text";
|
||||
export {default as xml, html, svg} from "./xml";
|
||||
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/json.js
generated
vendored
Normal file
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/json.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function responseJson(response) {
|
||||
if (!response.ok) throw new Error(response.status + " " + response.statusText);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export default function(input, init) {
|
||||
return fetch(input, init).then(responseJson);
|
||||
}
|
||||
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/text.js
generated
vendored
Normal file
8
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/text.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function responseText(response) {
|
||||
if (!response.ok) throw new Error(response.status + " " + response.statusText);
|
||||
return response.text();
|
||||
}
|
||||
|
||||
export default function(input, init) {
|
||||
return fetch(input, init).then(responseText);
|
||||
}
|
||||
15
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/xml.js
generated
vendored
Normal file
15
lisp/emacs-application-framework/app/mermaid/node_modules/d3-fetch/src/xml.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import text from "./text";
|
||||
|
||||
function parser(type) {
|
||||
return function(input, init) {
|
||||
return text(input, init).then(function(text) {
|
||||
return (new DOMParser).parseFromString(text, type);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default parser("application/xml");
|
||||
|
||||
export var html = parser("text/html");
|
||||
|
||||
export var svg = parser("image/svg+xml");
|
||||
Reference in New Issue
Block a user