@stll/docx-core 0.39.2 → 0.40.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/archive-yBR7X-Qc.js +456 -0
- package/dist/errors-Dm3jsb5q.d.ts +57 -0
- package/dist/format-DXPXB02u.js +378 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.js +106 -193
- package/dist/zip/archive.d.ts +114 -0
- package/dist/zip/archive.js +3 -0
- package/dist/zip/stream.d.ts +30 -0
- package/dist/zip/stream.js +117 -0
- package/package.json +10 -6
- package/dist/zip/writeZipPart.d.ts +0 -10
- package/dist/zip/writeZipPart.js +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/docx-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Typed OOXML/DOCX model, validation, serialization, legal-source compilation, and browser-native package projection.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|
|
@@ -58,9 +58,14 @@
|
|
|
58
58
|
"default": "./dist/schema/sequenceChildren.js"
|
|
59
59
|
},
|
|
60
60
|
"./zip": {
|
|
61
|
-
"types": "./dist/zip/
|
|
62
|
-
"import": "./dist/zip/
|
|
63
|
-
"default": "./dist/zip/
|
|
61
|
+
"types": "./dist/zip/archive.d.ts",
|
|
62
|
+
"import": "./dist/zip/archive.js",
|
|
63
|
+
"default": "./dist/zip/archive.js"
|
|
64
|
+
},
|
|
65
|
+
"./zip/stream": {
|
|
66
|
+
"types": "./dist/zip/stream.d.ts",
|
|
67
|
+
"import": "./dist/zip/stream.js",
|
|
68
|
+
"default": "./dist/zip/stream.js"
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
"publishConfig": {
|
|
@@ -79,10 +84,9 @@
|
|
|
79
84
|
"dependencies": {
|
|
80
85
|
"@nodable/entities": "^3.0.0",
|
|
81
86
|
"@stll/docx-utils": "^0.2.0",
|
|
82
|
-
"@stll/utf8-boundaries": "0.
|
|
87
|
+
"@stll/utf8-boundaries": "0.2.0",
|
|
83
88
|
"better-result": "3.0.1",
|
|
84
89
|
"fast-xml-parser": "^5.11.2",
|
|
85
|
-
"jszip": "3.10.2",
|
|
86
90
|
"marked": "^18.1.1"
|
|
87
91
|
},
|
|
88
92
|
"devDependencies": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import JSZip from "jszip";
|
|
2
|
-
type WriteZipPartOptions = {
|
|
3
|
-
zip: JSZip;
|
|
4
|
-
path: string;
|
|
5
|
-
data: Parameters<JSZip["loadAsync"]>[0];
|
|
6
|
-
options?: Omit<JSZip.JSZipFileOptions, "createFolders">;
|
|
7
|
-
};
|
|
8
|
-
/** Write exactly one entry, without synthesizing parent directory entries. */
|
|
9
|
-
export declare const writeZipPart: ({ zip, path, data, options }: WriteZipPartOptions) => void;
|
|
10
|
-
export {};
|
package/dist/zip/writeZipPart.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { writeZipEntry } from "@stll/utf8-boundaries";
|
|
2
|
-
// src/zip/writeZipPart.ts
|
|
3
|
-
const FIXED_ZIP_DATE_MS = Date.UTC(2e3, 0, 1);
|
|
4
|
-
const UNIX_DIRECTORY_FLAG = 16384;
|
|
5
|
-
const DOS_DIRECTORY_FLAG = 16;
|
|
6
|
-
/** Write exactly one entry, without synthesizing parent directory entries. */
|
|
7
|
-
const writeZipPart = ({ zip, path, data, options = {} }) => {
|
|
8
|
-
const unixPermissions = typeof options.unixPermissions === "string" ? Number.parseInt(options.unixPermissions, 8) : options.unixPermissions ?? 0;
|
|
9
|
-
if (options.dir === true || (unixPermissions & UNIX_DIRECTORY_FLAG) !== 0 || ((options.dosPermissions ?? 0) & DOS_DIRECTORY_FLAG) !== 0) data = /* @__PURE__ */ new Uint8Array();
|
|
10
|
-
writeZipEntry(zip, path, data, {
|
|
11
|
-
...options,
|
|
12
|
-
date: options.date ?? new Date(FIXED_ZIP_DATE_MS),
|
|
13
|
-
createFolders: false
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export { writeZipPart };
|