@d-i-t-a/reader 3.0.0-alpha.4 → 3.0.0-alpha.5
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/esm/index.js +12 -6
- package/dist/esm/index.js.map +2 -2
- package/dist/reader.js +29 -29
- package/dist/reader.js.map +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -88016,13 +88016,19 @@ var D2Reader = class _D2Reader {
|
|
|
88016
88016
|
if (pubInput instanceof Publication) {
|
|
88017
88017
|
publication = pubInput;
|
|
88018
88018
|
} else {
|
|
88019
|
-
const json =
|
|
88020
|
-
metadata: pubInput.
|
|
88021
|
-
|
|
88022
|
-
|
|
88023
|
-
|
|
88024
|
-
|
|
88019
|
+
const json = {
|
|
88020
|
+
metadata: pubInput.metadata ?? pubInput.Metadata ?? { title: "" },
|
|
88021
|
+
links: pubInput.links ?? pubInput.Links ?? [],
|
|
88022
|
+
readingOrder: pubInput.readingOrder ?? pubInput.spine ?? pubInput.Spine ?? [],
|
|
88023
|
+
resources: pubInput.resources ?? pubInput.Resources,
|
|
88024
|
+
toc: pubInput.toc ?? pubInput.TOC
|
|
88025
88025
|
};
|
|
88026
|
+
if (!json.metadata.title && !json.metadata.Title) {
|
|
88027
|
+
json.metadata.title = "";
|
|
88028
|
+
}
|
|
88029
|
+
if (json.metadata.Title && !json.metadata.title) {
|
|
88030
|
+
json.metadata.title = json.metadata.Title;
|
|
88031
|
+
}
|
|
88026
88032
|
const manifest = Ue.deserialize(json);
|
|
88027
88033
|
if (!manifest) {
|
|
88028
88034
|
throw new Error("Failed to parse publication manifest from config");
|