@applemusic-like-lyrics/lyric 0.0.3 → 0.1.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
@@ -4,7 +4,7 @@
4
4
  "SteveXMH <39523898+Steve-xmh@users.noreply.github.com>"
5
5
  ],
6
6
  "description": "一个歌词解析/生成模块,着重于歌词内容解析,支持多种格式",
7
- "version": "0.0.3",
7
+ "version": "0.1.0",
8
8
  "license": "GPL-3.0",
9
9
  "repository": {
10
10
  "type": "git",
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "scripts": {
14
14
  "build": "wasm-pack build --release",
15
- "build:dev": "wasm-pack build --dev"
15
+ "build:dev": "wasm-pack build --dev",
16
+ "fmt": "cargo fmt"
16
17
  },
17
18
  "files": [
18
19
  "pkg/*.wasm",
package/pkg/lyric.d.ts CHANGED
@@ -66,6 +66,20 @@ export function parseLys(src: string): LyricLine[];
66
66
  */
67
67
  export function stringifyLys(lines: LyricLine[]): string;
68
68
 
69
+ /**
70
+ * 解析 ESLyric 格式的歌词字符串
71
+ * @param src 歌词字符串
72
+ * @returns 成功解析出来的歌词
73
+ */
74
+ export function parseEslrc(src: string): LyricLine[];
75
+
76
+ /**
77
+ * 将歌词数组转换为 ESLyric 格式的字符串
78
+ * @param lines 歌词数组
79
+ * @returns ESLyric 格式的字符串
80
+ */
81
+ export function stringifyEslrc(lines: LyricLine[]): string;
82
+
69
83
  /**
70
84
  * 将歌词数组转换为 ASS 字幕格式的字符串
71
85
  *
package/pkg/lyric_bg.js CHANGED
@@ -4,53 +4,53 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
7
+ const heap = new Array(128).fill(undefined);
8
8
 
9
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
9
+ heap.push(undefined, null, true, false);
10
10
 
11
- cachedTextDecoder.decode();
11
+ function getObject(idx) { return heap[idx]; }
12
12
 
13
- let cachedUint8Memory0 = null;
13
+ let heap_next = heap.length;
14
14
 
15
- function getUint8Memory0() {
16
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
17
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
18
- }
19
- return cachedUint8Memory0;
15
+ function dropObject(idx) {
16
+ if (idx < 132) return;
17
+ heap[idx] = heap_next;
18
+ heap_next = idx;
20
19
  }
21
20
 
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
21
+ function takeObject(idx) {
22
+ const ret = getObject(idx);
23
+ dropObject(idx);
24
+ return ret;
25
25
  }
26
26
 
27
- const heap = new Array(128).fill(undefined);
28
-
29
- heap.push(undefined, null, true, false);
30
-
31
- let heap_next = heap.length;
32
-
33
27
  function addHeapObject(obj) {
34
28
  if (heap_next === heap.length) heap.push(heap.length + 1);
35
29
  const idx = heap_next;
36
30
  heap_next = heap[idx];
37
31
 
38
- if (typeof(heap_next) !== 'number') throw new Error('corrupt heap');
39
-
40
32
  heap[idx] = obj;
41
33
  return idx;
42
34
  }
43
35
 
44
- function getObject(idx) { return heap[idx]; }
36
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
37
+
38
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
39
+
40
+ cachedTextDecoder.decode();
45
41
 
46
- function _assertBoolean(n) {
47
- if (typeof(n) !== 'boolean') {
48
- throw new Error('expected a boolean argument');
42
+ let cachedUint8Memory0 = null;
43
+
44
+ function getUint8Memory0() {
45
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
46
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
49
47
  }
48
+ return cachedUint8Memory0;
50
49
  }
51
50
 
52
- function _assertNum(n) {
53
- if (typeof(n) !== 'number') throw new Error('expected a number argument');
51
+ function getStringFromWasm0(ptr, len) {
52
+ ptr = ptr >>> 0;
53
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
54
54
  }
55
55
 
56
56
  let WASM_VECTOR_LEN = 0;
@@ -74,8 +74,6 @@ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
74
74
 
75
75
  function passStringToWasm0(arg, malloc, realloc) {
76
76
 
77
- if (typeof(arg) !== 'string') throw new Error('expected a string argument');
78
-
79
77
  if (realloc === undefined) {
80
78
  const buf = cachedTextEncoder.encode(arg);
81
79
  const ptr = malloc(buf.length, 1) >>> 0;
@@ -104,7 +102,7 @@ function passStringToWasm0(arg, malloc, realloc) {
104
102
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
105
103
  const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
106
104
  const ret = encodeString(arg, view);
107
- if (ret.read !== arg.length) throw new Error('failed to pass whole string');
105
+
108
106
  offset += ret.written;
109
107
  }
110
108
 
@@ -125,18 +123,6 @@ function getInt32Memory0() {
125
123
  return cachedInt32Memory0;
126
124
  }
127
125
 
128
- function dropObject(idx) {
129
- if (idx < 132) return;
130
- heap[idx] = heap_next;
131
- heap_next = idx;
132
- }
133
-
134
- function takeObject(idx) {
135
- const ret = getObject(idx);
136
- dropObject(idx);
137
- return ret;
138
- }
139
-
140
126
  let cachedFloat64Memory0 = null;
141
127
 
142
128
  function getFloat64Memory0() {
@@ -146,6 +132,15 @@ function getFloat64Memory0() {
146
132
  return cachedFloat64Memory0;
147
133
  }
148
134
 
135
+ let cachedBigInt64Memory0 = null;
136
+
137
+ function getBigInt64Memory0() {
138
+ if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
139
+ cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
140
+ }
141
+ return cachedBigInt64Memory0;
142
+ }
143
+
149
144
  function debugString(val) {
150
145
  // primitive types
151
146
  const type = typeof val;
@@ -210,39 +205,58 @@ function debugString(val) {
210
205
  // TODO we could test for more things here, like `Set`s and `Map`s.
211
206
  return className;
212
207
  }
213
-
214
- function _assertBigInt(n) {
215
- if (typeof(n) !== 'bigint') throw new Error('expected a bigint argument');
216
- }
217
-
218
- let cachedBigInt64Memory0 = null;
219
-
220
- function getBigInt64Memory0() {
221
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
222
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
208
+ /**
209
+ * @param {any} lrc
210
+ * @returns {string}
211
+ */
212
+ export function stringifyAss(lrc) {
213
+ let deferred1_0;
214
+ let deferred1_1;
215
+ try {
216
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
217
+ wasm.stringifyAss(retptr, addHeapObject(lrc));
218
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
219
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
220
+ deferred1_0 = r0;
221
+ deferred1_1 = r1;
222
+ return getStringFromWasm0(r0, r1);
223
+ } finally {
224
+ wasm.__wbindgen_add_to_stack_pointer(16);
225
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
223
226
  }
224
- return cachedBigInt64Memory0;
225
227
  }
228
+
226
229
  /**
227
- * When the `console_error_panic_hook` feature is enabled, we can call the
228
- * `set_panic_hook` function at least once during initialization, and then
229
- * we will get better error messages if our code ever panics.
230
- *
231
- * For more details see
232
- * https://github.com/rustwasm/console_error_panic_hook#readme
230
+ * @param {string} hex_data
231
+ * @returns {string}
233
232
  */
234
- export function set_panic_hook() {
235
- wasm.set_panic_hook();
233
+ export function decryptQrcHex(hex_data) {
234
+ let deferred2_0;
235
+ let deferred2_1;
236
+ try {
237
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
238
+ const ptr0 = passStringToWasm0(hex_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
239
+ const len0 = WASM_VECTOR_LEN;
240
+ wasm.decryptQrcHex(retptr, ptr0, len0);
241
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
242
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
243
+ deferred2_0 = r0;
244
+ deferred2_1 = r1;
245
+ return getStringFromWasm0(r0, r1);
246
+ } finally {
247
+ wasm.__wbindgen_add_to_stack_pointer(16);
248
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
249
+ }
236
250
  }
237
251
 
238
252
  /**
239
253
  * @param {string} src
240
254
  * @returns {any}
241
255
  */
242
- export function parseLrc(src) {
256
+ export function parseEslrc(src) {
243
257
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
244
258
  const len0 = WASM_VECTOR_LEN;
245
- const ret = wasm.parseLrc(ptr0, len0);
259
+ const ret = wasm.parseEslrc(ptr0, len0);
246
260
  return takeObject(ret);
247
261
  }
248
262
 
@@ -250,12 +264,12 @@ export function parseLrc(src) {
250
264
  * @param {any} lrc
251
265
  * @returns {string}
252
266
  */
253
- export function stringifyLrc(lrc) {
267
+ export function stringifyEslrc(lrc) {
254
268
  let deferred1_0;
255
269
  let deferred1_1;
256
270
  try {
257
271
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
258
- wasm.stringifyLrc(retptr, addHeapObject(lrc));
272
+ wasm.stringifyEslrc(retptr, addHeapObject(lrc));
259
273
  var r0 = getInt32Memory0()[retptr / 4 + 0];
260
274
  var r1 = getInt32Memory0()[retptr / 4 + 1];
261
275
  deferred1_0 = r0;
@@ -271,10 +285,10 @@ export function stringifyLrc(lrc) {
271
285
  * @param {string} src
272
286
  * @returns {any}
273
287
  */
274
- export function parseQrc(src) {
288
+ export function parseLrc(src) {
275
289
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
290
  const len0 = WASM_VECTOR_LEN;
277
- const ret = wasm.parseQrc(ptr0, len0);
291
+ const ret = wasm.parseLrc(ptr0, len0);
278
292
  return takeObject(ret);
279
293
  }
280
294
 
@@ -282,12 +296,12 @@ export function parseQrc(src) {
282
296
  * @param {any} lrc
283
297
  * @returns {string}
284
298
  */
285
- export function stringifyQrc(lrc) {
299
+ export function stringifyLrc(lrc) {
286
300
  let deferred1_0;
287
301
  let deferred1_1;
288
302
  try {
289
303
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
290
- wasm.stringifyQrc(retptr, addHeapObject(lrc));
304
+ wasm.stringifyLrc(retptr, addHeapObject(lrc));
291
305
  var r0 = getInt32Memory0()[retptr / 4 + 0];
292
306
  var r1 = getInt32Memory0()[retptr / 4 + 1];
293
307
  deferred1_0 = r0;
@@ -299,16 +313,27 @@ export function stringifyQrc(lrc) {
299
313
  }
300
314
  }
301
315
 
316
+ /**
317
+ * @param {string} src
318
+ * @returns {any}
319
+ */
320
+ export function parseLys(src) {
321
+ const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len0 = WASM_VECTOR_LEN;
323
+ const ret = wasm.parseLys(ptr0, len0);
324
+ return takeObject(ret);
325
+ }
326
+
302
327
  /**
303
328
  * @param {any} lrc
304
329
  * @returns {string}
305
330
  */
306
- export function stringifyAss(lrc) {
331
+ export function stringifyLys(lrc) {
307
332
  let deferred1_0;
308
333
  let deferred1_1;
309
334
  try {
310
335
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
- wasm.stringifyAss(retptr, addHeapObject(lrc));
336
+ wasm.stringifyLys(retptr, addHeapObject(lrc));
312
337
  var r0 = getInt32Memory0()[retptr / 4 + 0];
313
338
  var r1 = getInt32Memory0()[retptr / 4 + 1];
314
339
  deferred1_0 = r0;
@@ -320,37 +345,14 @@ export function stringifyAss(lrc) {
320
345
  }
321
346
  }
322
347
 
323
- /**
324
- * @param {string} hex_data
325
- * @returns {string}
326
- */
327
- export function decryptQrcHex(hex_data) {
328
- let deferred2_0;
329
- let deferred2_1;
330
- try {
331
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
332
- const ptr0 = passStringToWasm0(hex_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
333
- const len0 = WASM_VECTOR_LEN;
334
- wasm.decryptQrcHex(retptr, ptr0, len0);
335
- var r0 = getInt32Memory0()[retptr / 4 + 0];
336
- var r1 = getInt32Memory0()[retptr / 4 + 1];
337
- deferred2_0 = r0;
338
- deferred2_1 = r1;
339
- return getStringFromWasm0(r0, r1);
340
- } finally {
341
- wasm.__wbindgen_add_to_stack_pointer(16);
342
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
343
- }
344
- }
345
-
346
348
  /**
347
349
  * @param {string} src
348
350
  * @returns {any}
349
351
  */
350
- export function parseYrc(src) {
352
+ export function parseQrc(src) {
351
353
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
354
  const len0 = WASM_VECTOR_LEN;
353
- const ret = wasm.parseYrc(ptr0, len0);
355
+ const ret = wasm.parseQrc(ptr0, len0);
354
356
  return takeObject(ret);
355
357
  }
356
358
 
@@ -358,12 +360,12 @@ export function parseYrc(src) {
358
360
  * @param {any} lrc
359
361
  * @returns {string}
360
362
  */
361
- export function stringifyYrc(lrc) {
363
+ export function stringifyQrc(lrc) {
362
364
  let deferred1_0;
363
365
  let deferred1_1;
364
366
  try {
365
367
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
366
- wasm.stringifyYrc(retptr, addHeapObject(lrc));
368
+ wasm.stringifyQrc(retptr, addHeapObject(lrc));
367
369
  var r0 = getInt32Memory0()[retptr / 4 + 0];
368
370
  var r1 = getInt32Memory0()[retptr / 4 + 1];
369
371
  deferred1_0 = r0;
@@ -375,14 +377,26 @@ export function stringifyYrc(lrc) {
375
377
  }
376
378
  }
377
379
 
380
+ /**
381
+ * When the `console_error_panic_hook` feature is enabled, we can call the
382
+ * `set_panic_hook` function at least once during initialization, and then
383
+ * we will get better error messages if our code ever panics.
384
+ *
385
+ * For more details see
386
+ * https://github.com/rustwasm/console_error_panic_hook#readme
387
+ */
388
+ export function set_panic_hook() {
389
+ wasm.set_panic_hook();
390
+ }
391
+
378
392
  /**
379
393
  * @param {string} src
380
394
  * @returns {any}
381
395
  */
382
- export function parseLys(src) {
396
+ export function parseYrc(src) {
383
397
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
384
398
  const len0 = WASM_VECTOR_LEN;
385
- const ret = wasm.parseLys(ptr0, len0);
399
+ const ret = wasm.parseYrc(ptr0, len0);
386
400
  return takeObject(ret);
387
401
  }
388
402
 
@@ -390,12 +404,12 @@ export function parseLys(src) {
390
404
  * @param {any} lrc
391
405
  * @returns {string}
392
406
  */
393
- export function stringifyLys(lrc) {
407
+ export function stringifyYrc(lrc) {
394
408
  let deferred1_0;
395
409
  let deferred1_1;
396
410
  try {
397
411
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
398
- wasm.stringifyLys(retptr, addHeapObject(lrc));
412
+ wasm.stringifyYrc(retptr, addHeapObject(lrc));
399
413
  var r0 = getInt32Memory0()[retptr / 4 + 0];
400
414
  var r1 = getInt32Memory0()[retptr / 4 + 1];
401
415
  deferred1_0 = r0;
@@ -407,22 +421,6 @@ export function stringifyLys(lrc) {
407
421
  }
408
422
  }
409
423
 
410
- function logError(f, args) {
411
- try {
412
- return f.apply(this, args);
413
- } catch (e) {
414
- let error = (function () {
415
- try {
416
- return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString();
417
- } catch(_) {
418
- return "<failed to stringify thrown value>";
419
- }
420
- }());
421
- console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error);
422
- throw e;
423
- }
424
- }
425
-
426
424
  function handleError(f, args) {
427
425
  try {
428
426
  return f.apply(this, args);
@@ -431,35 +429,46 @@ function handleError(f, args) {
431
429
  }
432
430
  }
433
431
 
432
+ export function __wbindgen_object_drop_ref(arg0) {
433
+ takeObject(arg0);
434
+ };
435
+
436
+ export function __wbindgen_is_bigint(arg0) {
437
+ const ret = typeof(getObject(arg0)) === 'bigint';
438
+ return ret;
439
+ };
440
+
441
+ export function __wbindgen_bigint_from_u64(arg0) {
442
+ const ret = BigInt.asUintN(64, arg0);
443
+ return addHeapObject(ret);
444
+ };
445
+
446
+ export function __wbindgen_jsval_eq(arg0, arg1) {
447
+ const ret = getObject(arg0) === getObject(arg1);
448
+ return ret;
449
+ };
450
+
434
451
  export function __wbindgen_error_new(arg0, arg1) {
435
452
  const ret = new Error(getStringFromWasm0(arg0, arg1));
436
453
  return addHeapObject(ret);
437
454
  };
438
455
 
456
+ export function __wbindgen_is_object(arg0) {
457
+ const val = getObject(arg0);
458
+ const ret = typeof(val) === 'object' && val !== null;
459
+ return ret;
460
+ };
461
+
439
462
  export function __wbindgen_is_undefined(arg0) {
440
463
  const ret = getObject(arg0) === undefined;
441
- _assertBoolean(ret);
442
464
  return ret;
443
465
  };
444
466
 
445
467
  export function __wbindgen_in(arg0, arg1) {
446
468
  const ret = getObject(arg0) in getObject(arg1);
447
- _assertBoolean(ret);
448
469
  return ret;
449
470
  };
450
471
 
451
- export function __wbindgen_boolean_get(arg0) {
452
- const v = getObject(arg0);
453
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
454
- _assertNum(ret);
455
- return ret;
456
- };
457
-
458
- export function __wbindgen_string_new(arg0, arg1) {
459
- const ret = getStringFromWasm0(arg0, arg1);
460
- return addHeapObject(ret);
461
- };
462
-
463
472
  export function __wbindgen_string_get(arg0, arg1) {
464
473
  const obj = getObject(arg1);
465
474
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -469,35 +478,26 @@ export function __wbindgen_string_get(arg0, arg1) {
469
478
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
470
479
  };
471
480
 
472
- export function __wbindgen_is_bigint(arg0) {
473
- const ret = typeof(getObject(arg0)) === 'bigint';
474
- _assertBoolean(ret);
475
- return ret;
476
- };
477
-
478
- export function __wbindgen_is_object(arg0) {
479
- const val = getObject(arg0);
480
- const ret = typeof(val) === 'object' && val !== null;
481
- _assertBoolean(ret);
482
- return ret;
483
- };
484
-
485
- export function __wbindgen_jsval_eq(arg0, arg1) {
486
- const ret = getObject(arg0) === getObject(arg1);
487
- _assertBoolean(ret);
481
+ export function __wbindgen_boolean_get(arg0) {
482
+ const v = getObject(arg0);
483
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
488
484
  return ret;
489
485
  };
490
486
 
491
- export function __wbindgen_bigint_from_u64(arg0) {
492
- const ret = BigInt.asUintN(64, arg0);
487
+ export function __wbg_new_abda76e883ba8a5f() {
488
+ const ret = new Error();
493
489
  return addHeapObject(ret);
494
490
  };
495
491
 
496
- export function __wbindgen_object_drop_ref(arg0) {
497
- takeObject(arg0);
492
+ export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
493
+ const ret = getObject(arg1).stack;
494
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
495
+ const len1 = WASM_VECTOR_LEN;
496
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
497
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
498
498
  };
499
499
 
500
- export function __wbg_error_f851667af71bcfc6() { return logError(function (arg0, arg1) {
500
+ export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
501
501
  let deferred0_0;
502
502
  let deferred0_1;
503
503
  try {
@@ -507,178 +507,170 @@ export function __wbg_error_f851667af71bcfc6() { return logError(function (arg0,
507
507
  } finally {
508
508
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
509
509
  }
510
- }, arguments) };
511
-
512
- export function __wbg_new_abda76e883ba8a5f() { return logError(function () {
513
- const ret = new Error();
514
- return addHeapObject(ret);
515
- }, arguments) };
516
-
517
- export function __wbg_stack_658279fe44541cf6() { return logError(function (arg0, arg1) {
518
- const ret = getObject(arg1).stack;
519
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
520
- const len1 = WASM_VECTOR_LEN;
521
- getInt32Memory0()[arg0 / 4 + 1] = len1;
522
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
523
- }, arguments) };
524
-
525
- export function __wbg_getwithrefkey_5e6d9547403deab8() { return logError(function (arg0, arg1) {
526
- const ret = getObject(arg0)[getObject(arg1)];
527
- return addHeapObject(ret);
528
- }, arguments) };
510
+ };
529
511
 
530
- export function __wbg_set_841ac57cff3d672b() { return logError(function (arg0, arg1, arg2) {
531
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
532
- }, arguments) };
512
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
513
+ const ret = getObject(arg0) == getObject(arg1);
514
+ return ret;
515
+ };
533
516
 
534
517
  export function __wbindgen_number_get(arg0, arg1) {
535
518
  const obj = getObject(arg1);
536
519
  const ret = typeof(obj) === 'number' ? obj : undefined;
537
- if (!isLikeNone(ret)) {
538
- _assertNum(ret);
539
- }
540
520
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
541
521
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
542
522
  };
543
523
 
524
+ export function __wbindgen_as_number(arg0) {
525
+ const ret = +getObject(arg0);
526
+ return ret;
527
+ };
528
+
544
529
  export function __wbindgen_number_new(arg0) {
545
530
  const ret = arg0;
546
531
  return addHeapObject(ret);
547
532
  };
548
533
 
549
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
550
- const ret = getObject(arg0) == getObject(arg1);
551
- _assertBoolean(ret);
552
- return ret;
553
- };
554
-
555
534
  export function __wbindgen_object_clone_ref(arg0) {
556
535
  const ret = getObject(arg0);
557
536
  return addHeapObject(ret);
558
537
  };
559
538
 
560
- export function __wbg_new_898a68150f225f2e() { return logError(function () {
561
- const ret = new Array();
539
+ export function __wbindgen_string_new(arg0, arg1) {
540
+ const ret = getStringFromWasm0(arg0, arg1);
562
541
  return addHeapObject(ret);
563
- }, arguments) };
542
+ };
564
543
 
565
- export function __wbg_get_44be0491f933a435() { return logError(function (arg0, arg1) {
566
- const ret = getObject(arg0)[arg1 >>> 0];
544
+ export function __wbg_getwithrefkey_4a92a5eca60879b9(arg0, arg1) {
545
+ const ret = getObject(arg0)[getObject(arg1)];
567
546
  return addHeapObject(ret);
568
- }, arguments) };
547
+ };
569
548
 
570
- export function __wbg_set_502d29070ea18557() { return logError(function (arg0, arg1, arg2) {
571
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
572
- }, arguments) };
549
+ export function __wbg_set_9182712abebf82ef(arg0, arg1, arg2) {
550
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
551
+ };
573
552
 
574
- export function __wbg_isArray_4c24b343cb13cfb1() { return logError(function (arg0) {
575
- const ret = Array.isArray(getObject(arg0));
576
- _assertBoolean(ret);
577
- return ret;
578
- }, arguments) };
553
+ export function __wbg_get_44be0491f933a435(arg0, arg1) {
554
+ const ret = getObject(arg0)[arg1 >>> 0];
555
+ return addHeapObject(ret);
556
+ };
579
557
 
580
- export function __wbg_length_fff51ee6522a1a18() { return logError(function (arg0) {
558
+ export function __wbg_length_fff51ee6522a1a18(arg0) {
581
559
  const ret = getObject(arg0).length;
582
- _assertNum(ret);
583
560
  return ret;
584
- }, arguments) };
561
+ };
585
562
 
586
- export function __wbg_instanceof_ArrayBuffer_39ac22089b74fddb() { return logError(function (arg0) {
587
- let result;
588
- try {
589
- result = getObject(arg0) instanceof ArrayBuffer;
590
- } catch {
591
- result = false;
592
- }
593
- const ret = result;
594
- _assertBoolean(ret);
563
+ export function __wbg_new_898a68150f225f2e() {
564
+ const ret = new Array();
565
+ return addHeapObject(ret);
566
+ };
567
+
568
+ export function __wbindgen_is_function(arg0) {
569
+ const ret = typeof(getObject(arg0)) === 'function';
595
570
  return ret;
596
- }, arguments) };
571
+ };
597
572
 
598
- export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
599
- const ret = getObject(arg0).call(getObject(arg1));
573
+ export function __wbg_next_526fc47e980da008(arg0) {
574
+ const ret = getObject(arg0).next;
600
575
  return addHeapObject(ret);
601
- }, arguments) };
576
+ };
602
577
 
603
578
  export function __wbg_next_ddb3312ca1c4e32a() { return handleError(function (arg0) {
604
579
  const ret = getObject(arg0).next();
605
580
  return addHeapObject(ret);
606
581
  }, arguments) };
607
582
 
608
- export function __wbg_next_526fc47e980da008() { return logError(function (arg0) {
609
- const ret = getObject(arg0).next;
610
- return addHeapObject(ret);
611
- }, arguments) };
612
-
613
- export function __wbg_done_5c1f01fb660d73b5() { return logError(function (arg0) {
583
+ export function __wbg_done_5c1f01fb660d73b5(arg0) {
614
584
  const ret = getObject(arg0).done;
615
- _assertBoolean(ret);
616
585
  return ret;
617
- }, arguments) };
586
+ };
618
587
 
619
- export function __wbg_value_1695675138684bd5() { return logError(function (arg0) {
588
+ export function __wbg_value_1695675138684bd5(arg0) {
620
589
  const ret = getObject(arg0).value;
621
590
  return addHeapObject(ret);
622
- }, arguments) };
591
+ };
623
592
 
624
- export function __wbg_isSafeInteger_bb8e18dd21c97288() { return logError(function (arg0) {
625
- const ret = Number.isSafeInteger(getObject(arg0));
626
- _assertBoolean(ret);
627
- return ret;
628
- }, arguments) };
593
+ export function __wbg_iterator_97f0c81209c6c35a() {
594
+ const ret = Symbol.iterator;
595
+ return addHeapObject(ret);
596
+ };
629
597
 
630
- export function __wbg_new_b51585de1b234aff() { return logError(function () {
631
- const ret = new Object();
598
+ export function __wbg_get_97b561fb56f034b5() { return handleError(function (arg0, arg1) {
599
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
632
600
  return addHeapObject(ret);
633
601
  }, arguments) };
634
602
 
635
- export function __wbg_iterator_97f0c81209c6c35a() { return logError(function () {
636
- const ret = Symbol.iterator;
603
+ export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
604
+ const ret = getObject(arg0).call(getObject(arg1));
637
605
  return addHeapObject(ret);
638
606
  }, arguments) };
639
607
 
640
- export function __wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4() { return logError(function (arg0) {
608
+ export function __wbg_new_b51585de1b234aff() {
609
+ const ret = new Object();
610
+ return addHeapObject(ret);
611
+ };
612
+
613
+ export function __wbg_set_502d29070ea18557(arg0, arg1, arg2) {
614
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
615
+ };
616
+
617
+ export function __wbg_isArray_4c24b343cb13cfb1(arg0) {
618
+ const ret = Array.isArray(getObject(arg0));
619
+ return ret;
620
+ };
621
+
622
+ export function __wbg_instanceof_ArrayBuffer_39ac22089b74fddb(arg0) {
641
623
  let result;
642
624
  try {
643
- result = getObject(arg0) instanceof Uint8Array;
625
+ result = getObject(arg0) instanceof ArrayBuffer;
644
626
  } catch {
645
627
  result = false;
646
628
  }
647
629
  const ret = result;
648
- _assertBoolean(ret);
649
630
  return ret;
650
- }, arguments) };
631
+ };
651
632
 
652
- export function __wbg_new_8125e318e6245eed() { return logError(function (arg0) {
653
- const ret = new Uint8Array(getObject(arg0));
633
+ export function __wbg_isSafeInteger_bb8e18dd21c97288(arg0) {
634
+ const ret = Number.isSafeInteger(getObject(arg0));
635
+ return ret;
636
+ };
637
+
638
+ export function __wbg_buffer_085ec1f694018c4f(arg0) {
639
+ const ret = getObject(arg0).buffer;
654
640
  return addHeapObject(ret);
655
- }, arguments) };
641
+ };
656
642
 
657
- export function __wbg_length_72e2208bbc0efc61() { return logError(function (arg0) {
658
- const ret = getObject(arg0).length;
659
- _assertNum(ret);
660
- return ret;
661
- }, arguments) };
643
+ export function __wbg_new_8125e318e6245eed(arg0) {
644
+ const ret = new Uint8Array(getObject(arg0));
645
+ return addHeapObject(ret);
646
+ };
662
647
 
663
- export function __wbg_set_5cf90238115182c3() { return logError(function (arg0, arg1, arg2) {
648
+ export function __wbg_set_5cf90238115182c3(arg0, arg1, arg2) {
664
649
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
665
- }, arguments) };
650
+ };
666
651
 
667
- export function __wbindgen_is_function(arg0) {
668
- const ret = typeof(getObject(arg0)) === 'function';
669
- _assertBoolean(ret);
652
+ export function __wbg_length_72e2208bbc0efc61(arg0) {
653
+ const ret = getObject(arg0).length;
670
654
  return ret;
671
655
  };
672
656
 
673
- export function __wbg_buffer_085ec1f694018c4f() { return logError(function (arg0) {
674
- const ret = getObject(arg0).buffer;
675
- return addHeapObject(ret);
676
- }, arguments) };
657
+ export function __wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4(arg0) {
658
+ let result;
659
+ try {
660
+ result = getObject(arg0) instanceof Uint8Array;
661
+ } catch {
662
+ result = false;
663
+ }
664
+ const ret = result;
665
+ return ret;
666
+ };
677
667
 
678
- export function __wbg_get_97b561fb56f034b5() { return handleError(function (arg0, arg1) {
679
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
680
- return addHeapObject(ret);
681
- }, arguments) };
668
+ export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
669
+ const v = getObject(arg1);
670
+ const ret = typeof(v) === 'bigint' ? v : undefined;
671
+ getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
672
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
673
+ };
682
674
 
683
675
  export function __wbindgen_debug_string(arg0, arg1) {
684
676
  const ret = debugString(getObject(arg1));
@@ -688,16 +680,6 @@ export function __wbindgen_debug_string(arg0, arg1) {
688
680
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
689
681
  };
690
682
 
691
- export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
692
- const v = getObject(arg1);
693
- const ret = typeof(v) === 'bigint' ? v : undefined;
694
- if (!isLikeNone(ret)) {
695
- _assertBigInt(ret);
696
- }
697
- getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
698
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
699
- };
700
-
701
683
  export function __wbindgen_throw(arg0, arg1) {
702
684
  throw new Error(getStringFromWasm0(arg0, arg1));
703
685
  };
package/pkg/lyric_bg.wasm CHANGED
Binary file
@@ -1,17 +1,19 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function set_panic_hook(): void;
4
+ export function stringifyAss(a: number, b: number): void;
5
+ export function decryptQrcHex(a: number, b: number, c: number): void;
6
+ export function parseEslrc(a: number, b: number): number;
7
+ export function stringifyEslrc(a: number, b: number): void;
5
8
  export function parseLrc(a: number, b: number): number;
6
9
  export function stringifyLrc(a: number, b: number): void;
10
+ export function parseLys(a: number, b: number): number;
11
+ export function stringifyLys(a: number, b: number): void;
7
12
  export function parseQrc(a: number, b: number): number;
8
13
  export function stringifyQrc(a: number, b: number): void;
9
- export function stringifyAss(a: number, b: number): void;
10
- export function decryptQrcHex(a: number, b: number, c: number): void;
14
+ export function set_panic_hook(): void;
11
15
  export function parseYrc(a: number, b: number): number;
12
16
  export function stringifyYrc(a: number, b: number): void;
13
- export function parseLys(a: number, b: number): number;
14
- export function stringifyLys(a: number, b: number): void;
15
17
  export function __wbindgen_malloc(a: number, b: number): number;
16
18
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
19
  export function __wbindgen_add_to_stack_pointer(a: number): number;