@prose-reader/streamer 1.99.0 → 1.100.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/generators/resources/hooks/selfClosingTagsFixHook.d.ts +13 -0
- package/dist/generators/resources/hooks/types.d.ts +1 -2
- package/dist/generators/resources/index.d.ts +1 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +383 -322
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +6 -16
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Archive } from '../../../archives/types';
|
|
2
|
+
import { HookResource } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Some books uses xhtml files but also includes wrong self closin tags. This happens
|
|
5
|
+
* a lot with kobo epub which have a lot of self closing <script ... />. This breaks on some
|
|
6
|
+
* browser such as webkit. We use a regex to replace and fix them. There
|
|
7
|
+
* is a first lighter regex which check if any such tag exist in the first place before running
|
|
8
|
+
* the full replace regex empty.
|
|
9
|
+
*/
|
|
10
|
+
export declare const selfClosingTagsFixHook: ({ archive, resourcePath }: {
|
|
11
|
+
archive: Archive;
|
|
12
|
+
resourcePath: string;
|
|
13
|
+
}) => (resource: HookResource) => Promise<HookResource>;
|
|
@@ -2,16 +2,6 @@ import { Archive } from '../..';
|
|
|
2
2
|
export declare const generateResourceFromArchive: (archive: Archive, resourcePath: string) => Promise<{
|
|
3
3
|
body: string | Blob;
|
|
4
4
|
params: {
|
|
5
|
-
|
|
6
|
-
status: number;
|
|
5
|
+
contentType?: string;
|
|
7
6
|
};
|
|
8
7
|
}>;
|
|
9
|
-
export declare const generateResourceFromError: (error: unknown) => {
|
|
10
|
-
body: string;
|
|
11
|
-
params: {
|
|
12
|
-
status: number;
|
|
13
|
-
headers: {
|
|
14
|
-
"Content-Type": string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { generateResourceFromArchive
|
|
1
|
+
export { generateResourceFromArchive } from './generators/resources';
|
|
2
2
|
export { generateManifestFromArchive } from './generators/manifest';
|
|
3
3
|
export { getArchiveOpfInfo } from './archives/getArchiveOpfInfo';
|
|
4
4
|
export { createArchiveFromUrls } from './archives/createArchiveFromUrls';
|