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