@truto/truto-jsonata 2.0.0 → 2.0.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 +1 -1
- package/dist/browser/index.js +12 -5
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/presets/core.js +12 -5
- package/dist/browser/presets/core.js.map +3 -3
- package/dist/cjs/index.cjs +12 -5
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/presets/core.cjs +12 -5
- package/dist/cjs/presets/core.cjs.map +3 -3
- package/dist/esm/index.js +12 -5
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/presets/core.js +12 -5
- package/dist/esm/presets/core.js.map +3 -3
- package/dist/functions/base64encode.d.ts +1 -1
- package/package.json +1 -1
|
@@ -10655,11 +10655,18 @@ var base64decode_default = base64decode;
|
|
|
10655
10655
|
|
|
10656
10656
|
// src/functions/base64encode.ts
|
|
10657
10657
|
function base64encode(input, urlSafe = false) {
|
|
10658
|
+
let bytes;
|
|
10659
|
+
if (input instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && input instanceof SharedArrayBuffer) {
|
|
10660
|
+
bytes = new Uint8Array(input);
|
|
10661
|
+
} else if (input instanceof Uint8Array) {
|
|
10662
|
+
bytes = input;
|
|
10663
|
+
} else {
|
|
10664
|
+
bytes = new TextEncoder().encode(input);
|
|
10665
|
+
}
|
|
10666
|
+
const CHUNK = 8192;
|
|
10658
10667
|
let binary = "";
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
for (let i = 0;i < len; i++) {
|
|
10662
|
-
binary += String.fromCharCode(bytes[i]);
|
|
10668
|
+
for (let i = 0;i < bytes.length; i += CHUNK) {
|
|
10669
|
+
binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + CHUNK)));
|
|
10663
10670
|
}
|
|
10664
10671
|
let base64 = btoa(binary);
|
|
10665
10672
|
if (urlSafe) {
|
|
@@ -12824,4 +12831,4 @@ export {
|
|
|
12824
12831
|
registerCoreExtensions
|
|
12825
12832
|
};
|
|
12826
12833
|
|
|
12827
|
-
//# debugId=
|
|
12834
|
+
//# debugId=74C2BC98EEFE8A5664756E2164756E21
|