@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.js
CHANGED
|
@@ -47,10 +47,10 @@ module.exports = cpp;
|
|
|
47
47
|
|
|
48
48
|
var expatlib_node = expatlib_node$1.exports;
|
|
49
49
|
|
|
50
|
-
var expatlib = /*#__PURE__*/
|
|
50
|
+
var expatlib = /*#__PURE__*/_mergeNamespaces({
|
|
51
51
|
__proto__: null,
|
|
52
52
|
'default': expatlib_node
|
|
53
|
-
}, [expatlib_node$1.exports])
|
|
53
|
+
}, [expatlib_node$1.exports]);
|
|
54
54
|
|
|
55
55
|
function getGlobal() {
|
|
56
56
|
if (typeof self !== "undefined") {
|
|
@@ -64,12 +64,12 @@ function getGlobal() {
|
|
|
64
64
|
}
|
|
65
65
|
throw new Error("unable to locate global object");
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const globalNS = getGlobal();
|
|
68
|
+
let _wasmFolder = globalNS.__hpcc_wasmFolder || undefined;
|
|
69
69
|
function wasmFolder(_) {
|
|
70
70
|
if (!arguments.length)
|
|
71
71
|
return _wasmFolder;
|
|
72
|
-
|
|
72
|
+
const retVal = _wasmFolder;
|
|
73
73
|
_wasmFolder = _;
|
|
74
74
|
return retVal;
|
|
75
75
|
}
|
|
@@ -86,13 +86,13 @@ function trimStart(str, charToRemove) {
|
|
|
86
86
|
return str;
|
|
87
87
|
}
|
|
88
88
|
function loadWasm(_wasmLib, wf, wasmBinary) {
|
|
89
|
-
|
|
89
|
+
const wasmLib = _wasmLib.default || _wasmLib;
|
|
90
90
|
// Prevent double load ---
|
|
91
91
|
if (!wasmLib.__hpcc_promise) {
|
|
92
92
|
wasmLib.__hpcc_promise = wasmLib({
|
|
93
|
-
wasmBinary
|
|
94
|
-
locateFile:
|
|
95
|
-
return
|
|
93
|
+
wasmBinary,
|
|
94
|
+
locateFile: (path, prefix) => {
|
|
95
|
+
return `${trimEnd(wf || wasmFolder() || prefix || ".", "/")}/${trimStart(path, "/")}`;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
@@ -100,66 +100,60 @@ function loadWasm(_wasmLib, wf, wasmBinary) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// @ts-ignore
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
class StackElement {
|
|
104
|
+
constructor(tag, attrs) {
|
|
105
105
|
this.tag = tag;
|
|
106
106
|
this.attrs = attrs;
|
|
107
107
|
this._content = "";
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
enumerable: false,
|
|
114
|
-
configurable: true
|
|
115
|
-
});
|
|
116
|
-
StackElement.prototype.appendContent = function (content) {
|
|
109
|
+
get content() {
|
|
110
|
+
return this._content;
|
|
111
|
+
}
|
|
112
|
+
appendContent(content) {
|
|
117
113
|
this._content += content;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
function StackParser() {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
class StackParser {
|
|
117
|
+
constructor() {
|
|
123
118
|
this._stack = [];
|
|
124
119
|
}
|
|
125
|
-
|
|
120
|
+
parse(xml, wasmFolder, wasmBinary) {
|
|
126
121
|
return parse(xml, this, wasmFolder, wasmBinary);
|
|
127
|
-
}
|
|
128
|
-
|
|
122
|
+
}
|
|
123
|
+
top() {
|
|
129
124
|
return this._stack[this._stack.length - 1];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
}
|
|
126
|
+
startElement(tag, attrs) {
|
|
127
|
+
const retVal = new StackElement(tag, attrs);
|
|
133
128
|
this._stack.push(retVal);
|
|
134
129
|
return retVal;
|
|
135
|
-
}
|
|
136
|
-
|
|
130
|
+
}
|
|
131
|
+
endElement(tag) {
|
|
137
132
|
return this._stack.pop();
|
|
138
|
-
}
|
|
139
|
-
|
|
133
|
+
}
|
|
134
|
+
characterData(content) {
|
|
140
135
|
this.top().appendContent(content);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}());
|
|
136
|
+
}
|
|
137
|
+
}
|
|
144
138
|
function parseAttrs(attrs) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
keys.split(sep2).filter(
|
|
150
|
-
|
|
139
|
+
const retVal = {};
|
|
140
|
+
const keys = attrs;
|
|
141
|
+
const sep = `${String.fromCharCode(1)}`;
|
|
142
|
+
const sep2 = `${sep}${sep}`;
|
|
143
|
+
keys.split(sep2).filter((key) => !!key).forEach((key) => {
|
|
144
|
+
const parts = key.split(sep);
|
|
151
145
|
retVal[parts[0]] = parts[1];
|
|
152
146
|
});
|
|
153
147
|
return retVal;
|
|
154
148
|
}
|
|
155
149
|
function expatVersion(wasmFolder, wasmBinary) {
|
|
156
|
-
return loadWasm(expatlib, wasmFolder, wasmBinary).then(
|
|
150
|
+
return loadWasm(expatlib, wasmFolder, wasmBinary).then(module => {
|
|
157
151
|
return module.CExpat.prototype.version();
|
|
158
152
|
});
|
|
159
153
|
}
|
|
160
154
|
function parse(xml, callback, wasmFolder, wasmBinary) {
|
|
161
|
-
return loadWasm(expatlib, wasmFolder, wasmBinary).then(
|
|
162
|
-
|
|
155
|
+
return loadWasm(expatlib, wasmFolder, wasmBinary).then(module => {
|
|
156
|
+
const parser = new module.CExpatJS();
|
|
163
157
|
parser.startElement = function () {
|
|
164
158
|
callback.startElement(this.tag(), parseAttrs(this.attrs()));
|
|
165
159
|
};
|
|
@@ -170,7 +164,7 @@ function parse(xml, callback, wasmFolder, wasmBinary) {
|
|
|
170
164
|
callback.characterData(this.content());
|
|
171
165
|
};
|
|
172
166
|
parser.create();
|
|
173
|
-
|
|
167
|
+
const retVal = parser.parse(xml);
|
|
174
168
|
parser.destroy();
|
|
175
169
|
module.destroy(parser);
|
|
176
170
|
return retVal;
|