@prose-reader/archive-parser 1.301.0 → 1.304.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/dist/comicInfo/manga.d.ts +0 -5
- package/dist/comicInfo/parse.d.ts +0 -16
- package/dist/index.d.ts +0 -5
- package/dist/index.js +313 -341
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/kobo/parse.d.ts +0 -8
- package/dist/opf/parse.d.ts +0 -29
- package/dist/opf/spineItemrefProperties.d.ts +0 -5
- package/dist/types/archiveResolve.d.ts +0 -49
- package/dist/utils/normalizeGtin.d.ts +0 -4
- package/dist/utils/normalizeIsbn.d.ts +0 -10
- package/dist/utils/parseW3cDtfDate.d.ts +0 -15
- package/dist/utils/tokenizeXmlSpaceSeparatedList.d.ts +0 -4
- package/package.json +2 -2
|
@@ -4,9 +4,4 @@ export type OpfItemrefLayoutHints = {
|
|
|
4
4
|
readonly pageSpreadLeft?: true;
|
|
5
5
|
readonly pageSpreadRight?: true;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* EPUB `itemref` `properties` attribute (space-separated tokens).
|
|
9
|
-
*
|
|
10
|
-
* @see https://www.w3.org/TR/epub/#attrdef-properties
|
|
11
|
-
*/
|
|
12
7
|
export declare const layoutHintsFromItemrefProperties: (properties: string | undefined) => OpfItemrefLayoutHints;
|
|
@@ -1,66 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cross-format hints for manifest-style consumers (identifiers, reading order,
|
|
3
|
-
* fixed-layout, descriptive metadata). Every field is populated by every
|
|
4
|
-
* `resolve*` — values default to `undefined` when the source format has no
|
|
5
|
-
* equivalent or the input is missing/blank, so consumers see a stable shape
|
|
6
|
-
* regardless of which container they're reading. Empty arrays/strings collapse
|
|
7
|
-
* to `undefined` so `result.field !== undefined` is a reliable presence check.
|
|
8
|
-
*
|
|
9
|
-
* Sources are container-agnostic: the same field can come from OPF Dublin
|
|
10
|
-
* Core (`dc:creator`, `dc:date`, …) or from a ComicInfo.xml element
|
|
11
|
-
* (`Writer`, `Year`/`Month`/`Day`, …).
|
|
12
|
-
*
|
|
13
|
-
* @see https://en.wikipedia.org/wiki/ISBN
|
|
14
|
-
*/
|
|
15
1
|
export type ArchiveResolveResult = {
|
|
16
|
-
/** Digits-only GTIN when the source matches a GS1 length (8 / 12 / 13 / 14). */
|
|
17
2
|
gtin?: string;
|
|
18
3
|
isbn?: string;
|
|
19
4
|
readingDirection?: "ltr" | "rtl";
|
|
20
5
|
renditionLayout?: "reflowable" | "pre-paginated";
|
|
21
|
-
/**
|
|
22
|
-
* Human-readable title of the work. OPF: `dc:title`. ComicInfo: `Title`.
|
|
23
|
-
* Bare archive series naming (`Series` without `Title`) is left to the
|
|
24
|
-
* consumer — the resolver doesn't fall back across container fields.
|
|
25
|
-
*/
|
|
26
6
|
title?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Primary creators, in document order. OPF: every `dc:creator`.
|
|
29
|
-
* ComicInfo: `Writer`, split on commas (the de facto schema convention).
|
|
30
|
-
* Other ComicInfo roles (`Penciller`, `Inker`, …) stay on the parsed
|
|
31
|
-
* object — folding them all in here would lose role attribution.
|
|
32
|
-
*/
|
|
33
7
|
authors?: string[];
|
|
34
|
-
/** OPF: first non-empty `dc:publisher`. ComicInfo: `Publisher`. */
|
|
35
8
|
publisher?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Rights / copyright statement. OPF: first non-empty `dc:rights`.
|
|
38
|
-
* ComicInfo has no spec'd rights field, so this is OPF-only today.
|
|
39
|
-
*/
|
|
40
9
|
rights?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Language tags. OPF: every `dc:language` (BCP 47). ComicInfo:
|
|
43
|
-
* `LanguageISO` lifted into a single-entry array; the schema is
|
|
44
|
-
* single-language by design but we keep the array shape so consumers
|
|
45
|
-
* can ignore the source format.
|
|
46
|
-
*/
|
|
47
10
|
languages?: string[];
|
|
48
|
-
/**
|
|
49
|
-
* Calendar components extracted from the source date. Each component
|
|
50
|
-
* is independently optional so partial dates (year only, year+month)
|
|
51
|
-
* round-trip faithfully. OPF: `dc:date` parsed as W3CDTF. ComicInfo:
|
|
52
|
-
* `Year` / `Month` / `Day` parsed as integers.
|
|
53
|
-
*/
|
|
54
11
|
date?: {
|
|
55
12
|
year?: number;
|
|
56
13
|
month?: number;
|
|
57
14
|
day?: number;
|
|
58
15
|
};
|
|
59
|
-
/**
|
|
60
|
-
* Subject keywords. OPF: every `dc:subject`. ComicInfo: `Genre`
|
|
61
|
-
* followed by `Tags`, both split on commas, in that order. The schema
|
|
62
|
-
* assigns slightly different intents to the two ComicInfo fields, but
|
|
63
|
-
* for the cross-format "subjects" lens they're equivalent.
|
|
64
|
-
*/
|
|
65
16
|
subjects?: string[];
|
|
66
17
|
};
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalize a raw ISBN-ish string into a canonical 10- or 13-character
|
|
3
|
-
* form, or `undefined` when no recognisable ISBN can be recovered.
|
|
4
|
-
*
|
|
5
|
-
* - Strips the common `urn:isbn:` / `isbn:` prefixes.
|
|
6
|
-
* - Drops everything that isn't a digit or `X`.
|
|
7
|
-
* - Validates the resulting length (10 or 13).
|
|
8
|
-
* - Falls back to a lax regex scan so publishers that stuff free text
|
|
9
|
-
* around the number still yield a usable value.
|
|
10
|
-
*/
|
|
11
1
|
export declare const normalizeIsbn: (raw: string | number | undefined | null) => string | undefined;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extract the calendar components of a W3CDTF literal — the
|
|
3
|
-
* date subset of ISO 8601 that EPUB 3.3 § 5.5.3.2.4 mandates for
|
|
4
|
-
* `dc:date`. Accepted forms: `YYYY`, `YYYY-MM`, `YYYY-MM-DD`, and
|
|
5
|
-
* any of the above followed by a `Thh:mm[:ss[.s]][TZD]` time
|
|
6
|
-
* portion that we ignore.
|
|
7
|
-
*
|
|
8
|
-
* Components are returned as plain integers (`month` is 1-12,
|
|
9
|
-
* `day` is 1-31), independent of the host timezone — using
|
|
10
|
-
* `Date.parse` would shift `2011-01-01` by a day in negative-offset
|
|
11
|
-
* locales, which is the exact bug this regex-based approach exists
|
|
12
|
-
* to avoid. Returns `undefined` when the input doesn't even match
|
|
13
|
-
* a leading 4-digit year so consumers can fall back without
|
|
14
|
-
* branching on partial shapes.
|
|
15
|
-
*/
|
|
16
1
|
export declare const parseW3cDtfDate: (raw: string | undefined) => {
|
|
17
2
|
year?: number;
|
|
18
3
|
month?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prose-reader/archive-parser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.304.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"xmldoc": "^2.0.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "1f4e4822d4d74fc2f6025409133db0f4f7f152af"
|
|
33
33
|
}
|