@json-eval-rs/vanilla 0.0.48 → 0.0.50
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/package.json +1 -1
- package/pkg/json_eval_rs.d.ts +4 -4
- package/pkg/json_eval_rs.js +8 -84
- package/pkg/json_eval_rs_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/json_eval_rs.d.ts
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* Get the library version
|
|
5
5
|
*/
|
|
6
6
|
export function getVersion(): string;
|
|
7
|
-
/**
|
|
8
|
-
* Initialize the library (sets up panic hook)
|
|
9
|
-
*/
|
|
10
|
-
export function init(): void;
|
|
11
7
|
/**
|
|
12
8
|
* Get library version (alias)
|
|
13
9
|
*/
|
|
14
10
|
export function version(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the library (sets up panic hook)
|
|
13
|
+
*/
|
|
14
|
+
export function init(): void;
|
|
15
15
|
/**
|
|
16
16
|
* WebAssembly wrapper for JSONEval
|
|
17
17
|
*/
|
package/pkg/json_eval_rs.js
CHANGED
|
@@ -135,71 +135,6 @@ function takeObject(idx) {
|
|
|
135
135
|
return ret;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
function debugString(val) {
|
|
139
|
-
// primitive types
|
|
140
|
-
const type = typeof val;
|
|
141
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
142
|
-
return `${val}`;
|
|
143
|
-
}
|
|
144
|
-
if (type == 'string') {
|
|
145
|
-
return `"${val}"`;
|
|
146
|
-
}
|
|
147
|
-
if (type == 'symbol') {
|
|
148
|
-
const description = val.description;
|
|
149
|
-
if (description == null) {
|
|
150
|
-
return 'Symbol';
|
|
151
|
-
} else {
|
|
152
|
-
return `Symbol(${description})`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (type == 'function') {
|
|
156
|
-
const name = val.name;
|
|
157
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
158
|
-
return `Function(${name})`;
|
|
159
|
-
} else {
|
|
160
|
-
return 'Function';
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
// objects
|
|
164
|
-
if (Array.isArray(val)) {
|
|
165
|
-
const length = val.length;
|
|
166
|
-
let debug = '[';
|
|
167
|
-
if (length > 0) {
|
|
168
|
-
debug += debugString(val[0]);
|
|
169
|
-
}
|
|
170
|
-
for(let i = 1; i < length; i++) {
|
|
171
|
-
debug += ', ' + debugString(val[i]);
|
|
172
|
-
}
|
|
173
|
-
debug += ']';
|
|
174
|
-
return debug;
|
|
175
|
-
}
|
|
176
|
-
// Test for built-in
|
|
177
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
178
|
-
let className;
|
|
179
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
180
|
-
className = builtInMatches[1];
|
|
181
|
-
} else {
|
|
182
|
-
// Failed to match the standard '[object ClassName]'
|
|
183
|
-
return toString.call(val);
|
|
184
|
-
}
|
|
185
|
-
if (className == 'Object') {
|
|
186
|
-
// we're a user defined class or Object
|
|
187
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
188
|
-
// easier than looping through ownProperties of `val`.
|
|
189
|
-
try {
|
|
190
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
191
|
-
} catch (_) {
|
|
192
|
-
return 'Object';
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
// errors
|
|
196
|
-
if (val instanceof Error) {
|
|
197
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
198
|
-
}
|
|
199
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
200
|
-
return className;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
138
|
function isLikeNone(x) {
|
|
204
139
|
return x === undefined || x === null;
|
|
205
140
|
}
|
|
@@ -234,13 +169,6 @@ export function getVersion() {
|
|
|
234
169
|
}
|
|
235
170
|
}
|
|
236
171
|
|
|
237
|
-
/**
|
|
238
|
-
* Initialize the library (sets up panic hook)
|
|
239
|
-
*/
|
|
240
|
-
export function init() {
|
|
241
|
-
wasm.init();
|
|
242
|
-
}
|
|
243
|
-
|
|
244
172
|
/**
|
|
245
173
|
* Get library version (alias)
|
|
246
174
|
* @returns {string}
|
|
@@ -262,6 +190,13 @@ export function version() {
|
|
|
262
190
|
}
|
|
263
191
|
}
|
|
264
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Initialize the library (sets up panic hook)
|
|
195
|
+
*/
|
|
196
|
+
export function init() {
|
|
197
|
+
wasm.init();
|
|
198
|
+
}
|
|
199
|
+
|
|
265
200
|
function passArray8ToWasm0(arg, malloc) {
|
|
266
201
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
267
202
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -2209,7 +2144,7 @@ function __wbg_get_imports() {
|
|
|
2209
2144
|
const ret = getObject(arg0).getTime();
|
|
2210
2145
|
return ret;
|
|
2211
2146
|
};
|
|
2212
|
-
imports.wbg.
|
|
2147
|
+
imports.wbg.__wbg_log_7ecc2e908f5170d8 = function(arg0, arg1) {
|
|
2213
2148
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
2214
2149
|
};
|
|
2215
2150
|
imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
|
|
@@ -2232,10 +2167,6 @@ function __wbg_get_imports() {
|
|
|
2232
2167
|
const ret = new Error();
|
|
2233
2168
|
return addHeapObject(ret);
|
|
2234
2169
|
};
|
|
2235
|
-
imports.wbg.__wbg_parse_442f5ba02e5eaf8b = function() { return handleError(function (arg0, arg1) {
|
|
2236
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
2237
|
-
return addHeapObject(ret);
|
|
2238
|
-
}, arguments) };
|
|
2239
2170
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
2240
2171
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2241
2172
|
};
|
|
@@ -2257,13 +2188,6 @@ function __wbg_get_imports() {
|
|
|
2257
2188
|
const ret = ValidationError.__wrap(arg0);
|
|
2258
2189
|
return addHeapObject(ret);
|
|
2259
2190
|
};
|
|
2260
|
-
imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
|
|
2261
|
-
const ret = debugString(getObject(arg1));
|
|
2262
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2263
|
-
const len1 = WASM_VECTOR_LEN;
|
|
2264
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2265
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2266
|
-
};
|
|
2267
2191
|
imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
|
|
2268
2192
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
2269
2193
|
return ret;
|
package/pkg/json_eval_rs_bg.wasm
CHANGED
|
Binary file
|