@csszyx/core 0.5.0 → 0.6.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 +2 -3
- package/pkg/csszyx_core.d.ts +25 -25
- package/pkg/csszyx_core_bg.js +51 -51
- package/pkg/csszyx_core_bg.wasm +0 -0
- package/pkg-node/csszyx_core.d.ts +25 -25
- package/pkg-node/csszyx_core.js +51 -51
- package/pkg-node/csszyx_core_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "WASM core for csszyx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"csszyx",
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "node scripts/preflight.mjs && wasm-pack build --mode no-install --target bundler --out-dir pkg && wasm-pack build --mode no-install --target nodejs --out-dir pkg-node && rm -f pkg/.gitignore pkg-node/.gitignore && node scripts/run-wasm-opt.mjs",
|
|
41
|
-
"
|
|
42
|
-
"test": "npm run build:test && vitest run",
|
|
41
|
+
"test": "vitest run",
|
|
43
42
|
"test:watch": "vitest",
|
|
44
43
|
"clean": "rm -rf pkg pkg-node target"
|
|
45
44
|
}
|
package/pkg/csszyx_core.d.ts
CHANGED
|
@@ -12,15 +12,6 @@
|
|
|
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
|
-
/**
|
|
24
15
|
* Initializes the WASM module.
|
|
25
16
|
*
|
|
26
17
|
* Should be called once before using any functions.
|
|
@@ -36,6 +27,15 @@ export function version(): string;
|
|
|
36
27
|
*/
|
|
37
28
|
export function init(): void;
|
|
38
29
|
/**
|
|
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,22 +110,6 @@ 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
|
-
/**
|
|
129
113
|
* Computes a deterministic SHA-256 checksum for a mangle map.
|
|
130
114
|
*
|
|
131
115
|
* The checksum is designed to be:
|
|
@@ -173,6 +157,22 @@ export function verify_mangle_checksum(map: any, expected_checksum: string): boo
|
|
|
173
157
|
*/
|
|
174
158
|
export function compute_mangle_checksum(map: any): string;
|
|
175
159
|
/**
|
|
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
|
package/pkg/csszyx_core_bg.js
CHANGED
|
@@ -223,6 +223,24 @@ 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
|
+
|
|
226
244
|
/**
|
|
227
245
|
* Gets the version of csszyx-core.
|
|
228
246
|
*
|
|
@@ -248,24 +266,6 @@ export function version() {
|
|
|
248
266
|
}
|
|
249
267
|
}
|
|
250
268
|
|
|
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,39 +378,6 @@ 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
|
-
|
|
414
381
|
/**
|
|
415
382
|
* Computes a deterministic SHA-256 checksum for a mangle map.
|
|
416
383
|
*
|
|
@@ -482,6 +449,39 @@ export function compute_mangle_checksum(map) {
|
|
|
482
449
|
}
|
|
483
450
|
}
|
|
484
451
|
|
|
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
|
*
|
package/pkg/csszyx_core_bg.wasm
CHANGED
|
Binary file
|
|
@@ -12,15 +12,6 @@
|
|
|
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
|
-
/**
|
|
24
15
|
* Initializes the WASM module.
|
|
25
16
|
*
|
|
26
17
|
* Should be called once before using any functions.
|
|
@@ -36,6 +27,15 @@ export function version(): string;
|
|
|
36
27
|
*/
|
|
37
28
|
export function init(): void;
|
|
38
29
|
/**
|
|
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,22 +110,6 @@ 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
|
-
/**
|
|
129
113
|
* Computes a deterministic SHA-256 checksum for a mangle map.
|
|
130
114
|
*
|
|
131
115
|
* The checksum is designed to be:
|
|
@@ -173,6 +157,22 @@ export function verify_mangle_checksum(map: any, expected_checksum: string): boo
|
|
|
173
157
|
*/
|
|
174
158
|
export function compute_mangle_checksum(map: any): string;
|
|
175
159
|
/**
|
|
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
|
package/pkg-node/csszyx_core.js
CHANGED
|
@@ -219,6 +219,24 @@ 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
|
+
|
|
222
240
|
/**
|
|
223
241
|
* Gets the version of csszyx-core.
|
|
224
242
|
*
|
|
@@ -244,24 +262,6 @@ module.exports.version = function() {
|
|
|
244
262
|
}
|
|
245
263
|
};
|
|
246
264
|
|
|
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,39 +374,6 @@ 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
|
-
|
|
410
377
|
/**
|
|
411
378
|
* Computes a deterministic SHA-256 checksum for a mangle map.
|
|
412
379
|
*
|
|
@@ -478,6 +445,39 @@ module.exports.compute_mangle_checksum = function(map) {
|
|
|
478
445
|
}
|
|
479
446
|
};
|
|
480
447
|
|
|
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
|