@veripublica/epubveri-wasm 0.36.0 → 0.37.1

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.
@@ -10,7 +10,7 @@ Generated by `cargo run -p epubveri-harness --bin notices`; do not edit.
10
10
 
11
11
  ================================================================
12
12
  bitflags 2.13.2 (MIT)
13
- log 0.4.34 (MIT)
13
+ log 0.4.35 (MIT)
14
14
  ================================================================
15
15
 
16
16
  Copyright (c) 2014 The Rust Project Developers
@@ -73,10 +73,10 @@ DEALINGS IN THE SOFTWARE.
73
73
 
74
74
  ================================================================
75
75
  cfg-if 1.0.5 (MIT)
76
- js-sys 0.3.106 (MIT)
77
- wasm-bindgen 0.2.129 (MIT)
78
- wasm-bindgen-shared 0.2.129 (MIT)
79
- web-sys 0.3.106 (MIT)
76
+ js-sys 0.3.107 (MIT)
77
+ wasm-bindgen 0.2.130 (MIT)
78
+ wasm-bindgen-shared 0.2.130 (MIT)
79
+ web-sys 0.3.107 (MIT)
80
80
  ================================================================
81
81
 
82
82
  Copyright (c) 2014 Alex Crichton
@@ -107,7 +107,7 @@ DEALINGS IN THE SOFTWARE.
107
107
 
108
108
 
109
109
  ================================================================
110
- crc32fast 1.5.2 (MIT)
110
+ crc32fast 1.5.4 (MIT)
111
111
  ================================================================
112
112
 
113
113
  MIT License
@@ -349,7 +349,6 @@ DEALINGS IN THE SOFTWARE.
349
349
 
350
350
  ================================================================
351
351
  itoa 1.0.18 (MIT)
352
- once_cell 1.21.4 (MIT)
353
352
  pin-project-lite 0.2.17 (MIT)
354
353
  serde 1.0.229 (MIT)
355
354
  serde_core 1.0.229 (MIT)
@@ -470,7 +469,7 @@ THE SOFTWARE.
470
469
 
471
470
 
472
471
  ================================================================
473
- roxmltree 0.21.1 (MIT)
472
+ roxmltree 0.21.2 (MIT)
474
473
  ================================================================
475
474
 
476
475
  The MIT License (MIT)
@@ -729,7 +728,7 @@ MIT License
729
728
 
730
729
 
731
730
  ================================================================
732
- zip 9.1.3 (MIT)
731
+ zip 9.3.0 (MIT)
733
732
  ================================================================
734
733
 
735
734
  The MIT License (MIT)
package/README.md CHANGED
@@ -102,7 +102,8 @@ epubcheck has no verdict on, in two families, both at `usage` severity:
102
102
  never load, a selector such as `#1a` or `p::before span` whose shape CSS rejects, so
103
103
  browsers drop the rule, and CSS a browser drops that epubcheck accepts: a pseudo-class
104
104
  such as `:hovr`, an at-rule such as `@medai`, an `@import` or `@namespace` after rules it
105
- must precede, a media feature such as `min-widht`, an `!important` inside a keyframe).
105
+ must precede, a media feature such as `min-widht`, an `!important` inside a keyframe, a
106
+ value its property cannot take such as `font-style: bold`).
106
107
 
107
108
  It is **off by default**: leaving the argument out, or passing `false`/`undefined`,
108
109
  produces a byte-identical report, so existing two-argument callers are unaffected. Neither
package/epubveri.d.ts CHANGED
@@ -158,7 +158,7 @@ export interface Data {
158
158
  * lowercase) is filename-based and intentionally not reachable here — this
159
159
  * entry point only ever sees bytes, never a filename.
160
160
  */
161
- export function validate(bytes: Uint8Array, profile?: string | null, advisory?: boolean | null, epub_version?: string | null): Report;
161
+ export function validate(bytes: Uint8Array | number[], profile?: string | null, advisory?: boolean | null, epub_version?: string | null): Report;
162
162
 
163
163
  /**
164
164
  * The validator version — [`epubveri::VERSION`], the one string the CLI's
package/epubveri_bg.js CHANGED
@@ -25,19 +25,27 @@
25
25
  * Note: the CLI-only PKG-016 check (the `.epub` file extension should be
26
26
  * lowercase) is filename-based and intentionally not reachable here — this
27
27
  * entry point only ever sees bytes, never a filename.
28
- * @param {Uint8Array} bytes
28
+ * @param {Uint8Array | number[]} bytes
29
29
  * @param {string | null} [profile]
30
30
  * @param {boolean | null} [advisory]
31
31
  * @param {string | null} [epub_version]
32
32
  * @returns {Report}
33
33
  */
34
34
  export function validate(bytes, profile, advisory, epub_version) {
35
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
36
- const len0 = WASM_VECTOR_LEN;
37
- var ptr1 = isLikeNone(profile) ? 0 : passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
38
- var len1 = WASM_VECTOR_LEN;
39
- var ptr2 = isLikeNone(epub_version) ? 0 : passStringToWasm0(epub_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
40
- var len2 = WASM_VECTOR_LEN;
35
+ let ptr0, len0, ptr1, len1, ptr2, len2;
36
+ try {
37
+ ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
38
+ len0 = WASM_VECTOR_LEN;
39
+ ptr1 = isLikeNone(profile) ? 0 : passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
40
+ len1 = WASM_VECTOR_LEN;
41
+ ptr2 = isLikeNone(epub_version) ? 0 : passStringToWasm0(epub_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
42
+ len2 = WASM_VECTOR_LEN;
43
+ } catch (e) {
44
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
45
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
46
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
47
+ throw e;
48
+ }
41
49
  const ret = wasm.validate(ptr0, len0, ptr1, len1, isLikeNone(advisory) ? 0xFFFFFF : advisory ? 1 : 0, ptr2, len2);
42
50
  if (ret[2]) {
43
51
  throw takeFromExternrefTable0(ret[1]);
@@ -63,7 +71,7 @@ export function version() {
63
71
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
64
72
  }
65
73
  }
66
- export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
74
+ export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
67
75
  const ret = Error(getStringFromWasm0(arg0, arg1));
68
76
  return ret;
69
77
  }
@@ -71,38 +79,38 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
71
79
  const ret = String(arg1);
72
80
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
81
  const len1 = WASM_VECTOR_LEN;
74
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
75
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
82
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
83
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
76
84
  }
77
- export function __wbg___wbindgen_is_string_90b56bc79aad6f6c(arg0) {
85
+ export function __wbg___wbindgen_is_string_fc456fee5d3317de(arg0) {
78
86
  const ret = typeof(arg0) === 'string';
79
87
  return ret;
80
88
  }
81
- export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
89
+ export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
82
90
  throw new Error(getStringFromWasm0(arg0, arg1));
83
91
  }
84
- export function __wbg_new_28744009d011f847() {
85
- const ret = new Map();
92
+ export function __wbg_new_37eb45aaf5eeb820() {
93
+ const ret = new Array();
86
94
  return ret;
87
95
  }
88
- export function __wbg_new_617a8cdb8bb1130e() {
89
- const ret = new Object();
96
+ export function __wbg_new_7075786089b89c5e() {
97
+ const ret = new Map();
90
98
  return ret;
91
99
  }
92
- export function __wbg_new_ee2291f50781bf1d() {
93
- const ret = new Array();
100
+ export function __wbg_new_cd4348290afae586() {
101
+ const ret = new Object();
94
102
  return ret;
95
103
  }
96
- export function __wbg_set_6ae97e73113c4f0b(arg0, arg1, arg2) {
104
+ export function __wbg_set_8282f7e0d2d01336(arg0, arg1, arg2) {
97
105
  const ret = arg0.set(arg1, arg2);
98
106
  return ret;
99
107
  }
100
- export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
101
- arg0[arg1] = arg2;
102
- }
103
- export function __wbg_set_bea140a88be9b277(arg0, arg1, arg2) {
108
+ export function __wbg_set_d2d33b52458e984a(arg0, arg1, arg2) {
104
109
  arg0[arg1 >>> 0] = arg2;
105
110
  }
111
+ export function __wbg_set_e4b9a833d288759a(arg0, arg1, arg2) {
112
+ arg0[arg1] = arg2;
113
+ }
106
114
  export function __wbindgen_generic_0000000000000001(arg0) {
107
115
  // Cast intrinsic for `F64 -> Externref`.
108
116
  const ret = arg0;
@@ -120,12 +128,11 @@ export function __wbindgen_generic_0000000000000003(arg0) {
120
128
  }
121
129
  export function __wbindgen_init_externref_table() {
122
130
  const table = wasm.__wbindgen_externrefs;
123
- const offset = table.grow(4);
124
131
  table.set(0, undefined);
125
- table.set(offset + 0, undefined);
126
- table.set(offset + 1, null);
127
- table.set(offset + 2, true);
128
- table.set(offset + 3, false);
132
+ table.set(1024, undefined);
133
+ table.set(1025, null);
134
+ table.set(1026, true);
135
+ table.set(1027, false);
129
136
  }
130
137
  let cachedDataViewMemory0 = null;
131
138
  function getDataViewMemory0() {
@@ -136,7 +143,8 @@ function getDataViewMemory0() {
136
143
  }
137
144
 
138
145
  function getStringFromWasm0(ptr, len) {
139
- return decodeText(ptr >>> 0, len);
146
+ ptr = ptr >>> 0;
147
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
140
148
  }
141
149
 
142
150
  let cachedUint8ArrayMemory0 = null;
@@ -201,18 +209,18 @@ function takeFromExternrefTable0(idx) {
201
209
  return value;
202
210
  }
203
211
 
204
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
212
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
205
213
  cachedTextDecoder.decode();
206
214
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
207
215
  let numBytesDecoded = 0;
208
- function decodeText(ptr, len) {
209
- numBytesDecoded += len;
216
+ function decodeText(bytes) {
217
+ numBytesDecoded += bytes.length;
210
218
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
211
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
219
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
212
220
  cachedTextDecoder.decode();
213
- numBytesDecoded = len;
221
+ numBytesDecoded = bytes.length;
214
222
  }
215
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
223
+ return cachedTextDecoder.decode(bytes);
216
224
  }
217
225
 
218
226
  const cachedTextEncoder = new TextEncoder();
package/epubveri_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@veripublica/epubveri-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for epubveri — a pure-Rust, JVM-free EPUB validator that runs in the browser.",
5
- "version": "0.36.0",
5
+ "version": "0.37.1",
6
6
  "license": "AGPL-3.0-only OR LicenseRef-veripublica-Commercial",
7
7
  "repository": {
8
8
  "type": "git",