@csszyx/core 0.6.0 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "WASM core for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -12,6 +12,15 @@
12
12
  */
13
13
  export function transform_sz(val: any): string;
14
14
  /**
15
+ * Gets the version of csszyx-core.
16
+ *
17
+ * # Returns
18
+ *
19
+ * Version string
20
+ * @returns {string}
21
+ */
22
+ export function version(): string;
23
+ /**
15
24
  * Initializes the WASM module.
16
25
  *
17
26
  * Should be called once before using any functions.
@@ -27,15 +36,6 @@ export function transform_sz(val: any): string;
27
36
  */
28
37
  export function init(): void;
29
38
  /**
30
- * Gets the version of csszyx-core.
31
- *
32
- * # Returns
33
- *
34
- * Version string
35
- * @returns {string}
36
- */
37
- export function version(): string;
38
- /**
39
39
  * Generates a cryptographic token for a recovery declaration.
40
40
  *
41
41
  * # Arguments
@@ -110,6 +110,22 @@ export function generate_token(component: string, path: string, line: number, co
110
110
  */
111
111
  export function verify_token(token: string, component: string, path: string, line: number, column: number, mode: string, build_id: string): boolean;
112
112
  /**
113
+ * WASM-exposed checksum verification.
114
+ *
115
+ * # Arguments
116
+ *
117
+ * * `map` - JavaScript object representing the mangle map
118
+ * * `expected_checksum` - The expected checksum string
119
+ *
120
+ * # Returns
121
+ *
122
+ * `true` if checksum matches, `false` otherwise
123
+ * @param {any} map
124
+ * @param {string} expected_checksum
125
+ * @returns {boolean}
126
+ */
127
+ export function verify_mangle_checksum(map: any, expected_checksum: string): boolean;
128
+ /**
113
129
  * Computes a deterministic SHA-256 checksum for a mangle map.
114
130
  *
115
131
  * The checksum is designed to be:
@@ -157,22 +173,6 @@ export function verify_token(token: string, component: string, path: string, lin
157
173
  */
158
174
  export function compute_mangle_checksum(map: any): string;
159
175
  /**
160
- * WASM-exposed checksum verification.
161
- *
162
- * # Arguments
163
- *
164
- * * `map` - JavaScript object representing the mangle map
165
- * * `expected_checksum` - The expected checksum string
166
- *
167
- * # Returns
168
- *
169
- * `true` if checksum matches, `false` otherwise
170
- * @param {any} map
171
- * @param {string} expected_checksum
172
- * @returns {boolean}
173
- */
174
- export function verify_mangle_checksum(map: any, expected_checksum: string): boolean;
175
- /**
176
176
  * Encodes an index to a reversed tier-based Base62 string.
177
177
  *
178
178
  * # Arguments
@@ -223,24 +223,6 @@ export function transform_sz(val) {
223
223
  }
224
224
  }
225
225
 
226
- /**
227
- * Initializes the WASM module.
228
- *
229
- * Should be called once before using any functions.
230
- *
231
- * # Examples
232
- *
233
- * ```javascript
234
- * import init, { encode } from 'csszyx-core';
235
- *
236
- * await init();
237
- * const id = encode(42);
238
- * ```
239
- */
240
- export function init() {
241
- wasm.init();
242
- }
243
-
244
226
  /**
245
227
  * Gets the version of csszyx-core.
246
228
  *
@@ -266,6 +248,24 @@ export function version() {
266
248
  }
267
249
  }
268
250
 
251
+ /**
252
+ * Initializes the WASM module.
253
+ *
254
+ * Should be called once before using any functions.
255
+ *
256
+ * # Examples
257
+ *
258
+ * ```javascript
259
+ * import init, { encode } from 'csszyx-core';
260
+ *
261
+ * await init();
262
+ * const id = encode(42);
263
+ * ```
264
+ */
265
+ export function init() {
266
+ wasm.init();
267
+ }
268
+
269
269
  /**
270
270
  * Generates a cryptographic token for a recovery declaration.
271
271
  *
@@ -378,6 +378,39 @@ export function verify_token(token, component, path, line, column, mode, build_i
378
378
  return ret !== 0;
379
379
  }
380
380
 
381
+ /**
382
+ * WASM-exposed checksum verification.
383
+ *
384
+ * # Arguments
385
+ *
386
+ * * `map` - JavaScript object representing the mangle map
387
+ * * `expected_checksum` - The expected checksum string
388
+ *
389
+ * # Returns
390
+ *
391
+ * `true` if checksum matches, `false` otherwise
392
+ * @param {any} map
393
+ * @param {string} expected_checksum
394
+ * @returns {boolean}
395
+ */
396
+ export function verify_mangle_checksum(map, expected_checksum) {
397
+ try {
398
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
399
+ const ptr0 = passStringToWasm0(expected_checksum, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
400
+ const len0 = WASM_VECTOR_LEN;
401
+ wasm.verify_mangle_checksum(retptr, addHeapObject(map), ptr0, len0);
402
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
403
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
404
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
405
+ if (r2) {
406
+ throw takeObject(r1);
407
+ }
408
+ return r0 !== 0;
409
+ } finally {
410
+ wasm.__wbindgen_add_to_stack_pointer(16);
411
+ }
412
+ }
413
+
381
414
  /**
382
415
  * Computes a deterministic SHA-256 checksum for a mangle map.
383
416
  *
@@ -449,39 +482,6 @@ export function compute_mangle_checksum(map) {
449
482
  }
450
483
  }
451
484
 
452
- /**
453
- * WASM-exposed checksum verification.
454
- *
455
- * # Arguments
456
- *
457
- * * `map` - JavaScript object representing the mangle map
458
- * * `expected_checksum` - The expected checksum string
459
- *
460
- * # Returns
461
- *
462
- * `true` if checksum matches, `false` otherwise
463
- * @param {any} map
464
- * @param {string} expected_checksum
465
- * @returns {boolean}
466
- */
467
- export function verify_mangle_checksum(map, expected_checksum) {
468
- try {
469
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
470
- const ptr0 = passStringToWasm0(expected_checksum, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
471
- const len0 = WASM_VECTOR_LEN;
472
- wasm.verify_mangle_checksum(retptr, addHeapObject(map), ptr0, len0);
473
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
474
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
475
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
476
- if (r2) {
477
- throw takeObject(r1);
478
- }
479
- return r0 !== 0;
480
- } finally {
481
- wasm.__wbindgen_add_to_stack_pointer(16);
482
- }
483
- }
484
-
485
485
  /**
486
486
  * Encodes an index to a reversed tier-based Base62 string.
487
487
  *
Binary file
@@ -12,6 +12,15 @@
12
12
  */
13
13
  export function transform_sz(val: any): string;
14
14
  /**
15
+ * Gets the version of csszyx-core.
16
+ *
17
+ * # Returns
18
+ *
19
+ * Version string
20
+ * @returns {string}
21
+ */
22
+ export function version(): string;
23
+ /**
15
24
  * Initializes the WASM module.
16
25
  *
17
26
  * Should be called once before using any functions.
@@ -27,15 +36,6 @@ export function transform_sz(val: any): string;
27
36
  */
28
37
  export function init(): void;
29
38
  /**
30
- * Gets the version of csszyx-core.
31
- *
32
- * # Returns
33
- *
34
- * Version string
35
- * @returns {string}
36
- */
37
- export function version(): string;
38
- /**
39
39
  * Generates a cryptographic token for a recovery declaration.
40
40
  *
41
41
  * # Arguments
@@ -110,6 +110,22 @@ export function generate_token(component: string, path: string, line: number, co
110
110
  */
111
111
  export function verify_token(token: string, component: string, path: string, line: number, column: number, mode: string, build_id: string): boolean;
112
112
  /**
113
+ * WASM-exposed checksum verification.
114
+ *
115
+ * # Arguments
116
+ *
117
+ * * `map` - JavaScript object representing the mangle map
118
+ * * `expected_checksum` - The expected checksum string
119
+ *
120
+ * # Returns
121
+ *
122
+ * `true` if checksum matches, `false` otherwise
123
+ * @param {any} map
124
+ * @param {string} expected_checksum
125
+ * @returns {boolean}
126
+ */
127
+ export function verify_mangle_checksum(map: any, expected_checksum: string): boolean;
128
+ /**
113
129
  * Computes a deterministic SHA-256 checksum for a mangle map.
114
130
  *
115
131
  * The checksum is designed to be:
@@ -157,22 +173,6 @@ export function verify_token(token: string, component: string, path: string, lin
157
173
  */
158
174
  export function compute_mangle_checksum(map: any): string;
159
175
  /**
160
- * WASM-exposed checksum verification.
161
- *
162
- * # Arguments
163
- *
164
- * * `map` - JavaScript object representing the mangle map
165
- * * `expected_checksum` - The expected checksum string
166
- *
167
- * # Returns
168
- *
169
- * `true` if checksum matches, `false` otherwise
170
- * @param {any} map
171
- * @param {string} expected_checksum
172
- * @returns {boolean}
173
- */
174
- export function verify_mangle_checksum(map: any, expected_checksum: string): boolean;
175
- /**
176
176
  * Encodes an index to a reversed tier-based Base62 string.
177
177
  *
178
178
  * # Arguments
@@ -219,24 +219,6 @@ module.exports.transform_sz = function(val) {
219
219
  }
220
220
  };
221
221
 
222
- /**
223
- * Initializes the WASM module.
224
- *
225
- * Should be called once before using any functions.
226
- *
227
- * # Examples
228
- *
229
- * ```javascript
230
- * import init, { encode } from 'csszyx-core';
231
- *
232
- * await init();
233
- * const id = encode(42);
234
- * ```
235
- */
236
- module.exports.init = function() {
237
- wasm.init();
238
- };
239
-
240
222
  /**
241
223
  * Gets the version of csszyx-core.
242
224
  *
@@ -262,6 +244,24 @@ module.exports.version = function() {
262
244
  }
263
245
  };
264
246
 
247
+ /**
248
+ * Initializes the WASM module.
249
+ *
250
+ * Should be called once before using any functions.
251
+ *
252
+ * # Examples
253
+ *
254
+ * ```javascript
255
+ * import init, { encode } from 'csszyx-core';
256
+ *
257
+ * await init();
258
+ * const id = encode(42);
259
+ * ```
260
+ */
261
+ module.exports.init = function() {
262
+ wasm.init();
263
+ };
264
+
265
265
  /**
266
266
  * Generates a cryptographic token for a recovery declaration.
267
267
  *
@@ -374,6 +374,39 @@ module.exports.verify_token = function(token, component, path, line, column, mod
374
374
  return ret !== 0;
375
375
  };
376
376
 
377
+ /**
378
+ * WASM-exposed checksum verification.
379
+ *
380
+ * # Arguments
381
+ *
382
+ * * `map` - JavaScript object representing the mangle map
383
+ * * `expected_checksum` - The expected checksum string
384
+ *
385
+ * # Returns
386
+ *
387
+ * `true` if checksum matches, `false` otherwise
388
+ * @param {any} map
389
+ * @param {string} expected_checksum
390
+ * @returns {boolean}
391
+ */
392
+ module.exports.verify_mangle_checksum = function(map, expected_checksum) {
393
+ try {
394
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
395
+ const ptr0 = passStringToWasm0(expected_checksum, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
396
+ const len0 = WASM_VECTOR_LEN;
397
+ wasm.verify_mangle_checksum(retptr, addHeapObject(map), ptr0, len0);
398
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
399
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
400
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
401
+ if (r2) {
402
+ throw takeObject(r1);
403
+ }
404
+ return r0 !== 0;
405
+ } finally {
406
+ wasm.__wbindgen_add_to_stack_pointer(16);
407
+ }
408
+ };
409
+
377
410
  /**
378
411
  * Computes a deterministic SHA-256 checksum for a mangle map.
379
412
  *
@@ -445,39 +478,6 @@ module.exports.compute_mangle_checksum = function(map) {
445
478
  }
446
479
  };
447
480
 
448
- /**
449
- * WASM-exposed checksum verification.
450
- *
451
- * # Arguments
452
- *
453
- * * `map` - JavaScript object representing the mangle map
454
- * * `expected_checksum` - The expected checksum string
455
- *
456
- * # Returns
457
- *
458
- * `true` if checksum matches, `false` otherwise
459
- * @param {any} map
460
- * @param {string} expected_checksum
461
- * @returns {boolean}
462
- */
463
- module.exports.verify_mangle_checksum = function(map, expected_checksum) {
464
- try {
465
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
466
- const ptr0 = passStringToWasm0(expected_checksum, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
- const len0 = WASM_VECTOR_LEN;
468
- wasm.verify_mangle_checksum(retptr, addHeapObject(map), ptr0, len0);
469
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
470
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
471
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
472
- if (r2) {
473
- throw takeObject(r1);
474
- }
475
- return r0 !== 0;
476
- } finally {
477
- wasm.__wbindgen_add_to_stack_pointer(16);
478
- }
479
- };
480
-
481
481
  /**
482
482
  * Encodes an index to a reversed tier-based Base62 string.
483
483
  *
Binary file