@storyteller-platform/epub 0.5.0 → 0.5.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.
- package/README.md +151 -151
- package/dist/index.cjs +6 -2
- package/dist/index.js +13 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -423,7 +423,7 @@ ${JSON.stringify(element, null, 2)}`
|
|
|
423
423
|
await zipfile.close();
|
|
424
424
|
});
|
|
425
425
|
for await (const entry of zipfile) {
|
|
426
|
-
if (entry.filename.endsWith(
|
|
426
|
+
if (entry.filename.endsWith(import_path.sep)) {
|
|
427
427
|
} else {
|
|
428
428
|
const writePath = (0, import_path.join)(extractPath, entry.filename);
|
|
429
429
|
const readStream = await entry.openReadStream();
|
|
@@ -1785,7 +1785,11 @@ ${JSON.stringify(element, null, 2)}`
|
|
|
1785
1785
|
*/
|
|
1786
1786
|
resolveInternalHref(from, href) {
|
|
1787
1787
|
const startPath = (0, import_path.dirname)(from);
|
|
1788
|
-
return (0, import_path.resolve)(
|
|
1788
|
+
return (0, import_path.resolve)(
|
|
1789
|
+
this.extractPath,
|
|
1790
|
+
(0, import_path.hrefToPlatformPath)(startPath),
|
|
1791
|
+
(0, import_path.hrefToPlatformPath)(href)
|
|
1792
|
+
);
|
|
1789
1793
|
}
|
|
1790
1794
|
/**
|
|
1791
1795
|
* Returns a path-relative-scheme-less URL, relative to the
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,13 @@ import { lookup } from "mime-types";
|
|
|
14
14
|
import { nanoid } from "nanoid";
|
|
15
15
|
import { fromBuffer, open } from "yauzl-promise";
|
|
16
16
|
import { ZipFile } from "yazl";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
dirname,
|
|
19
|
+
hrefToPlatformPath,
|
|
20
|
+
join,
|
|
21
|
+
resolve,
|
|
22
|
+
sep
|
|
23
|
+
} from "@storyteller-platform/path";
|
|
18
24
|
import * as Upgrade from "./upgrade.js";
|
|
19
25
|
const MP3_FILE_EXTENSIONS = [".mp3"];
|
|
20
26
|
const MPEG4_FILE_EXTENSIONS = [".mp4", ".m4a", ".m4b"];
|
|
@@ -348,7 +354,7 @@ ${JSON.stringify(element, null, 2)}`
|
|
|
348
354
|
await zipfile.close();
|
|
349
355
|
});
|
|
350
356
|
for await (const entry of zipfile) {
|
|
351
|
-
if (entry.filename.endsWith(
|
|
357
|
+
if (entry.filename.endsWith(sep)) {
|
|
352
358
|
} else {
|
|
353
359
|
const writePath = join(extractPath, entry.filename);
|
|
354
360
|
const readStream = await entry.openReadStream();
|
|
@@ -1710,7 +1716,11 @@ ${JSON.stringify(element, null, 2)}`
|
|
|
1710
1716
|
*/
|
|
1711
1717
|
resolveInternalHref(from, href) {
|
|
1712
1718
|
const startPath = dirname(from);
|
|
1713
|
-
return resolve(
|
|
1719
|
+
return resolve(
|
|
1720
|
+
this.extractPath,
|
|
1721
|
+
hrefToPlatformPath(startPath),
|
|
1722
|
+
hrefToPlatformPath(href)
|
|
1723
|
+
);
|
|
1714
1724
|
}
|
|
1715
1725
|
/**
|
|
1716
1726
|
* Returns a path-relative-scheme-less URL, relative to the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyteller-platform/epub",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@storyteller-platform/fs": "^0.1.4",
|
|
51
|
-
"@storyteller-platform/path": "^0.1.
|
|
51
|
+
"@storyteller-platform/path": "^0.1.2",
|
|
52
52
|
"@zip.js/zip.js": "^2.0.0",
|
|
53
53
|
"async-mutex": "^0.5.0",
|
|
54
54
|
"fast-xml-parser": "^4.0.1",
|