abstract-document 16.0.31 → 16.0.32
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/lib/abstract-document-exporters/shared/to-base-64.d.ts +3 -0
- package/lib/abstract-document-exporters/shared/to-base-64.d.ts.map +1 -0
- package/lib/abstract-document-exporters/shared/to-base-64.js +19 -0
- package/lib/abstract-document-exporters/shared/to-base-64.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-base-64.d.ts","sourceRoot":"","sources":["../../../src/abstract-document-exporters/shared/to-base-64.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAarD;AAED,eAAO,MAAM,YAAY,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rawSvgPrefix = void 0;
|
|
4
|
+
exports.toBase64String = toBase64String;
|
|
5
|
+
function toBase64String(u8) {
|
|
6
|
+
const imageFormat = u8[0] === 0xff && u8[1] === 0xd8 ? "image/jpeg" : "image/png";
|
|
7
|
+
// Node
|
|
8
|
+
if (typeof Buffer !== "undefined") {
|
|
9
|
+
return `data:${imageFormat};base64,${Buffer.from(u8).toString("base64")}`;
|
|
10
|
+
}
|
|
11
|
+
// Browser
|
|
12
|
+
let bin = "";
|
|
13
|
+
for (const e of u8) {
|
|
14
|
+
bin += String.fromCharCode(e);
|
|
15
|
+
}
|
|
16
|
+
return `data:${imageFormat};base64,${btoa(bin)}`;
|
|
17
|
+
}
|
|
18
|
+
exports.rawSvgPrefix = "data:image/svg+xml,";
|
|
19
|
+
//# sourceMappingURL=to-base-64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-base-64.js","sourceRoot":"","sources":["../../../src/abstract-document-exporters/shared/to-base-64.ts"],"names":[],"mappings":";;;AAAA,wCAaC;AAbD,SAAgB,cAAc,CAAC,EAAc;IAC3C,MAAM,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IAClF,OAAO;IACP,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,QAAQ,WAAW,WAAW,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC5E,CAAC;IACD,UAAU;IACV,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACnB,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,QAAQ,WAAW,WAAW,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACnD,CAAC;AAEY,QAAA,YAAY,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abstract-document",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.32",
|
|
4
4
|
"description": "Dynamically create documents using code or JSX and render to any format",
|
|
5
5
|
"repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-document",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"!/**/__tests__"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"abstract-image": "^11.2.
|
|
22
|
+
"abstract-image": "^11.2.7",
|
|
23
23
|
"docx": "^6.0.3",
|
|
24
24
|
"fast-xml-parser": "^4.5.0",
|
|
25
25
|
"handlebars": "4.7.8",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"vite": "^6.0.1",
|
|
49
49
|
"vitest": "^2.1.6"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "542da28fd124a6eaa276ceb3c8d4876c416d1a66"
|
|
52
52
|
}
|