@hpcc-js/wasm 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -7
- package/bin/cli.js +21 -1
- package/dist/expat.es6.js +41 -47
- package/dist/expat.es6.js.map +1 -1
- package/dist/expat.js +41 -47
- package/dist/expat.js.map +1 -1
- package/dist/expat.node.es6.js +41 -47
- package/dist/expat.node.es6.js.map +1 -1
- package/dist/expat.node.js +41 -47
- package/dist/expat.node.js.map +1 -1
- package/dist/graphviz.es6.js +57 -91
- package/dist/graphviz.es6.js.map +1 -1
- package/dist/graphviz.js +57 -91
- package/dist/graphviz.js.map +1 -1
- package/dist/graphviz.node.es6.js +57 -91
- package/dist/graphviz.node.es6.js.map +1 -1
- package/dist/graphviz.node.js +57 -91
- package/dist/graphviz.node.js.map +1 -1
- package/dist/graphvizlib.wasm +0 -0
- package/dist/index.es6.js +91 -131
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +91 -131
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.es6.js +91 -131
- package/dist/index.node.es6.js.map +1 -1
- package/dist/index.node.js +91 -131
- package/dist/index.node.js.map +1 -1
- package/package.json +13 -13
package/dist/expat.node.es6.js
CHANGED
|
@@ -38,10 +38,10 @@ module.exports = cpp;
|
|
|
38
38
|
|
|
39
39
|
var expatlib_node = expatlib_node$1.exports;
|
|
40
40
|
|
|
41
|
-
var expatlib = /*#__PURE__*/
|
|
41
|
+
var expatlib = /*#__PURE__*/_mergeNamespaces({
|
|
42
42
|
__proto__: null,
|
|
43
43
|
'default': expatlib_node
|
|
44
|
-
}, [expatlib_node$1.exports])
|
|
44
|
+
}, [expatlib_node$1.exports]);
|
|
45
45
|
|
|
46
46
|
function getGlobal() {
|
|
47
47
|
if (typeof self !== "undefined") {
|
|
@@ -55,12 +55,12 @@ function getGlobal() {
|
|
|
55
55
|
}
|
|
56
56
|
throw new Error("unable to locate global object");
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const globalNS = getGlobal();
|
|
59
|
+
let _wasmFolder = globalNS.__hpcc_wasmFolder || undefined;
|
|
60
60
|
function wasmFolder(_) {
|
|
61
61
|
if (!arguments.length)
|
|
62
62
|
return _wasmFolder;
|
|
63
|
-
|
|
63
|
+
const retVal = _wasmFolder;
|
|
64
64
|
_wasmFolder = _;
|
|
65
65
|
return retVal;
|
|
66
66
|
}
|
|
@@ -77,13 +77,13 @@ function trimStart(str, charToRemove) {
|
|
|
77
77
|
return str;
|
|
78
78
|
}
|
|
79
79
|
function loadWasm(_wasmLib, wf, wasmBinary) {
|
|
80
|
-
|
|
80
|
+
const wasmLib = _wasmLib.default || _wasmLib;
|
|
81
81
|
// Prevent double load ---
|
|
82
82
|
if (!wasmLib.__hpcc_promise) {
|
|
83
83
|
wasmLib.__hpcc_promise = wasmLib({
|
|
84
|
-
wasmBinary
|
|
85
|
-
locateFile:
|
|
86
|
-
return
|
|
84
|
+
wasmBinary,
|
|
85
|
+
locateFile: (path, prefix) => {
|
|
86
|
+
return `${trimEnd(wf || wasmFolder() || prefix || ".", "/")}/${trimStart(path, "/")}`;
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -91,66 +91,60 @@ function loadWasm(_wasmLib, wf, wasmBinary) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// @ts-ignore
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
class StackElement {
|
|
95
|
+
constructor(tag, attrs) {
|
|
96
96
|
this.tag = tag;
|
|
97
97
|
this.attrs = attrs;
|
|
98
98
|
this._content = "";
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
enumerable: false,
|
|
105
|
-
configurable: true
|
|
106
|
-
});
|
|
107
|
-
StackElement.prototype.appendContent = function (content) {
|
|
100
|
+
get content() {
|
|
101
|
+
return this._content;
|
|
102
|
+
}
|
|
103
|
+
appendContent(content) {
|
|
108
104
|
this._content += content;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function StackParser() {
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
class StackParser {
|
|
108
|
+
constructor() {
|
|
114
109
|
this._stack = [];
|
|
115
110
|
}
|
|
116
|
-
|
|
111
|
+
parse(xml, wasmFolder, wasmBinary) {
|
|
117
112
|
return parse(xml, this, wasmFolder, wasmBinary);
|
|
118
|
-
}
|
|
119
|
-
|
|
113
|
+
}
|
|
114
|
+
top() {
|
|
120
115
|
return this._stack[this._stack.length - 1];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
}
|
|
117
|
+
startElement(tag, attrs) {
|
|
118
|
+
const retVal = new StackElement(tag, attrs);
|
|
124
119
|
this._stack.push(retVal);
|
|
125
120
|
return retVal;
|
|
126
|
-
}
|
|
127
|
-
|
|
121
|
+
}
|
|
122
|
+
endElement(tag) {
|
|
128
123
|
return this._stack.pop();
|
|
129
|
-
}
|
|
130
|
-
|
|
124
|
+
}
|
|
125
|
+
characterData(content) {
|
|
131
126
|
this.top().appendContent(content);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
}());
|
|
127
|
+
}
|
|
128
|
+
}
|
|
135
129
|
function parseAttrs(attrs) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
keys.split(sep2).filter(
|
|
141
|
-
|
|
130
|
+
const retVal = {};
|
|
131
|
+
const keys = attrs;
|
|
132
|
+
const sep = `${String.fromCharCode(1)}`;
|
|
133
|
+
const sep2 = `${sep}${sep}`;
|
|
134
|
+
keys.split(sep2).filter((key) => !!key).forEach((key) => {
|
|
135
|
+
const parts = key.split(sep);
|
|
142
136
|
retVal[parts[0]] = parts[1];
|
|
143
137
|
});
|
|
144
138
|
return retVal;
|
|
145
139
|
}
|
|
146
140
|
function expatVersion(wasmFolder, wasmBinary) {
|
|
147
|
-
return loadWasm(expatlib, wasmFolder, wasmBinary).then(
|
|
141
|
+
return loadWasm(expatlib, wasmFolder, wasmBinary).then(module => {
|
|
148
142
|
return module.CExpat.prototype.version();
|
|
149
143
|
});
|
|
150
144
|
}
|
|
151
145
|
function parse(xml, callback, wasmFolder, wasmBinary) {
|
|
152
|
-
return loadWasm(expatlib, wasmFolder, wasmBinary).then(
|
|
153
|
-
|
|
146
|
+
return loadWasm(expatlib, wasmFolder, wasmBinary).then(module => {
|
|
147
|
+
const parser = new module.CExpatJS();
|
|
154
148
|
parser.startElement = function () {
|
|
155
149
|
callback.startElement(this.tag(), parseAttrs(this.attrs()));
|
|
156
150
|
};
|
|
@@ -161,7 +155,7 @@ function parse(xml, callback, wasmFolder, wasmBinary) {
|
|
|
161
155
|
callback.characterData(this.content());
|
|
162
156
|
};
|
|
163
157
|
parser.create();
|
|
164
|
-
|
|
158
|
+
const retVal = parser.parse(xml);
|
|
165
159
|
parser.destroy();
|
|
166
160
|
module.destroy(parser);
|
|
167
161
|
return retVal;
|