@veripublica/epubveri-wasm 0.7.13 → 0.8.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/epubveri.d.ts +8 -1
- package/epubveri_bg.js +12 -2
- package/epubveri_bg.wasm +0 -0
- package/package.json +1 -1
package/epubveri.d.ts
CHANGED
|
@@ -93,11 +93,18 @@ export interface Data {
|
|
|
93
93
|
* leaves them off, and with them off the report is byte-identical — so
|
|
94
94
|
* existing two-argument callers are unaffected.
|
|
95
95
|
*
|
|
96
|
+
* `epub_version` mirrors the CLI `-v` flag — pass `"2"`, `"2.0"`, `"3"`,
|
|
97
|
+
* `"3.0"` to validate against that version whatever the book declares, or
|
|
98
|
+
* `undefined`/`null` to judge it as what it declares. On a disagreement
|
|
99
|
+
* PKG-001 reports it and the requested version wins, so forcing a 3.0 book
|
|
100
|
+
* to 2.0 produces a long report. Unrecognized values behave like
|
|
101
|
+
* `undefined`, matching how `profile` treats an unknown name.
|
|
102
|
+
*
|
|
96
103
|
* Note: the CLI-only PKG-016 check (the `.epub` file extension should be
|
|
97
104
|
* lowercase) is filename-based and intentionally not reachable here — this
|
|
98
105
|
* entry point only ever sees bytes, never a filename.
|
|
99
106
|
*/
|
|
100
|
-
export function validate(bytes: Uint8Array, profile?: string | null, advisory?: boolean | null): Report;
|
|
107
|
+
export function validate(bytes: Uint8Array, profile?: string | null, advisory?: boolean | null, epub_version?: string | null): Report;
|
|
101
108
|
|
|
102
109
|
/**
|
|
103
110
|
* The validator version — [`epubveri::VERSION`], the one string the CLI's
|
package/epubveri_bg.js
CHANGED
|
@@ -12,20 +12,30 @@
|
|
|
12
12
|
* leaves them off, and with them off the report is byte-identical — so
|
|
13
13
|
* existing two-argument callers are unaffected.
|
|
14
14
|
*
|
|
15
|
+
* `epub_version` mirrors the CLI `-v` flag — pass `"2"`, `"2.0"`, `"3"`,
|
|
16
|
+
* `"3.0"` to validate against that version whatever the book declares, or
|
|
17
|
+
* `undefined`/`null` to judge it as what it declares. On a disagreement
|
|
18
|
+
* PKG-001 reports it and the requested version wins, so forcing a 3.0 book
|
|
19
|
+
* to 2.0 produces a long report. Unrecognized values behave like
|
|
20
|
+
* `undefined`, matching how `profile` treats an unknown name.
|
|
21
|
+
*
|
|
15
22
|
* Note: the CLI-only PKG-016 check (the `.epub` file extension should be
|
|
16
23
|
* lowercase) is filename-based and intentionally not reachable here — this
|
|
17
24
|
* entry point only ever sees bytes, never a filename.
|
|
18
25
|
* @param {Uint8Array} bytes
|
|
19
26
|
* @param {string | null} [profile]
|
|
20
27
|
* @param {boolean | null} [advisory]
|
|
28
|
+
* @param {string | null} [epub_version]
|
|
21
29
|
* @returns {Report}
|
|
22
30
|
*/
|
|
23
|
-
export function validate(bytes, profile, advisory) {
|
|
31
|
+
export function validate(bytes, profile, advisory, epub_version) {
|
|
24
32
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
25
33
|
const len0 = WASM_VECTOR_LEN;
|
|
26
34
|
var ptr1 = isLikeNone(profile) ? 0 : passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
27
35
|
var len1 = WASM_VECTOR_LEN;
|
|
28
|
-
|
|
36
|
+
var ptr2 = isLikeNone(epub_version) ? 0 : passStringToWasm0(epub_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
37
|
+
var len2 = WASM_VECTOR_LEN;
|
|
38
|
+
const ret = wasm.validate(ptr0, len0, ptr1, len1, isLikeNone(advisory) ? 0xFFFFFF : advisory ? 1 : 0, ptr2, len2);
|
|
29
39
|
return ret;
|
|
30
40
|
}
|
|
31
41
|
|
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.
|
|
5
|
+
"version": "0.8.0",
|
|
6
6
|
"license": "AGPL-3.0-only OR LicenseRef-veripublica-Commercial",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|