@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.
@@ -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
- const bytes = new TextEncoder().encode(input);
10660
- const len = bytes.length;
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=43581F0BED16C38764756E2164756E21
12834
+ //# debugId=74C2BC98EEFE8A5664756E2164756E21