@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/dist/expat.js CHANGED
@@ -41,10 +41,10 @@
41
41
 
42
42
  var expatlib = expatlib$2.exports;
43
43
 
44
- var expatlib$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
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
- var globalNS = getGlobal();
62
- var _wasmFolder = globalNS.__hpcc_wasmFolder || undefined;
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
- var retVal = _wasmFolder;
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
- var wasmLib = _wasmLib.default || _wasmLib;
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: wasmBinary,
88
- locateFile: function (path, prefix) {
89
- return "".concat(trimEnd(wf || wasmFolder() || prefix || ".", "/"), "/").concat(trimStart(path, "/"));
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
- var StackElement = /** @class */ (function () {
98
- function StackElement(tag, attrs) {
97
+ class StackElement {
98
+ constructor(tag, attrs) {
99
99
  this.tag = tag;
100
100
  this.attrs = attrs;
101
101
  this._content = "";
102
102
  }
103
- Object.defineProperty(StackElement.prototype, "content", {
104
- get: function () {
105
- return this._content;
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
- return StackElement;
114
- }());
115
- var StackParser = /** @class */ (function () {
116
- function StackParser() {
108
+ }
109
+ }
110
+ class StackParser {
111
+ constructor() {
117
112
  this._stack = [];
118
113
  }
119
- StackParser.prototype.parse = function (xml, wasmFolder, wasmBinary) {
114
+ parse(xml, wasmFolder, wasmBinary) {
120
115
  return parse(xml, this, wasmFolder, wasmBinary);
121
- };
122
- StackParser.prototype.top = function () {
116
+ }
117
+ top() {
123
118
  return this._stack[this._stack.length - 1];
124
- };
125
- StackParser.prototype.startElement = function (tag, attrs) {
126
- var retVal = new StackElement(tag, attrs);
119
+ }
120
+ startElement(tag, attrs) {
121
+ const retVal = new StackElement(tag, attrs);
127
122
  this._stack.push(retVal);
128
123
  return retVal;
129
- };
130
- StackParser.prototype.endElement = function (tag) {
124
+ }
125
+ endElement(tag) {
131
126
  return this._stack.pop();
132
- };
133
- StackParser.prototype.characterData = function (content) {
127
+ }
128
+ characterData(content) {
134
129
  this.top().appendContent(content);
135
- };
136
- return StackParser;
137
- }());
130
+ }
131
+ }
138
132
  function parseAttrs(attrs) {
139
- var retVal = {};
140
- var keys = attrs;
141
- var sep = "".concat(String.fromCharCode(1));
142
- var sep2 = "".concat(sep).concat(sep);
143
- keys.split(sep2).filter(function (key) { return !!key; }).forEach(function (key) {
144
- var parts = key.split(sep);
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(function (module) {
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(function (module) {
156
- var parser = new module.CExpatJS();
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
- var retVal = parser.parse(xml);
161
+ const retVal = parser.parse(xml);
168
162
  parser.destroy();
169
163
  module.destroy(parser);
170
164
  return retVal;