@json-eval-rs/vanilla 0.0.48 → 0.0.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-eval-rs/vanilla",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "JSON Eval RS for direct browser usage (vanilla JS) or manual WASM loading (Next.js Turbopack compat)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Get the library version
5
- */
6
- export function getVersion(): string;
7
3
  /**
8
4
  * Initialize the library (sets up panic hook)
9
5
  */
@@ -12,6 +8,10 @@ export function init(): void;
12
8
  * Get library version (alias)
13
9
  */
14
10
  export function version(): string;
11
+ /**
12
+ * Get the library version
13
+ */
14
+ export function getVersion(): string;
15
15
  /**
16
16
  * WebAssembly wrapper for JSONEval
17
17
  */
@@ -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
  }
@@ -214,10 +149,17 @@ function passArrayJsValueToWasm0(array, malloc) {
214
149
  return ptr;
215
150
  }
216
151
  /**
217
- * Get the library version
152
+ * Initialize the library (sets up panic hook)
153
+ */
154
+ export function init() {
155
+ wasm.init();
156
+ }
157
+
158
+ /**
159
+ * Get library version (alias)
218
160
  * @returns {string}
219
161
  */
220
- export function getVersion() {
162
+ export function version() {
221
163
  let deferred1_0;
222
164
  let deferred1_1;
223
165
  try {
@@ -235,17 +177,10 @@ export function getVersion() {
235
177
  }
236
178
 
237
179
  /**
238
- * Initialize the library (sets up panic hook)
239
- */
240
- export function init() {
241
- wasm.init();
242
- }
243
-
244
- /**
245
- * Get library version (alias)
180
+ * Get the library version
246
181
  * @returns {string}
247
182
  */
248
- export function version() {
183
+ export function getVersion() {
249
184
  let deferred1_0;
250
185
  let deferred1_1;
251
186
  try {
@@ -2209,7 +2144,7 @@ function __wbg_get_imports() {
2209
2144
  const ret = getObject(arg0).getTime();
2210
2145
  return ret;
2211
2146
  };
2212
- imports.wbg.__wbg_log_335f2dafcd729af1 = function(arg0, arg1) {
2147
+ imports.wbg.__wbg_log_bb412d517df4ef42 = 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;
Binary file