@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.
@@ -63706,11 +63706,18 @@ var base64decode_default = base64decode;
63706
63706
 
63707
63707
  // src/functions/base64encode.ts
63708
63708
  function base64encode(input, urlSafe = false) {
63709
+ let bytes;
63710
+ if (input instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && input instanceof SharedArrayBuffer) {
63711
+ bytes = new Uint8Array(input);
63712
+ } else if (input instanceof Uint8Array) {
63713
+ bytes = input;
63714
+ } else {
63715
+ bytes = new TextEncoder().encode(input);
63716
+ }
63717
+ const CHUNK = 8192;
63709
63718
  let binary = "";
63710
- const bytes = new TextEncoder().encode(input);
63711
- const len = bytes.length;
63712
- for (let i2 = 0;i2 < len; i2++) {
63713
- binary += String.fromCharCode(bytes[i2]);
63719
+ for (let i2 = 0;i2 < bytes.length; i2 += CHUNK) {
63720
+ binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i2, i2 + CHUNK)));
63714
63721
  }
63715
63722
  let base642 = btoa(binary);
63716
63723
  if (urlSafe) {
@@ -79801,4 +79808,4 @@ function trutoJsonata(expression) {
79801
79808
  return registerJsonataExtensions(import_jsonata.default(expression));
79802
79809
  }
79803
79810
 
79804
- //# debugId=79EB9819B812B62A64756E2164756E21
79811
+ //# debugId=7032513BD5BB377164756E2164756E21