@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.
@@ -10660,11 +10660,18 @@ var base64decode_default = base64decode;
10660
10660
 
10661
10661
  // src/functions/base64encode.ts
10662
10662
  function base64encode(input, urlSafe = false) {
10663
+ let bytes;
10664
+ if (input instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && input instanceof SharedArrayBuffer) {
10665
+ bytes = new Uint8Array(input);
10666
+ } else if (input instanceof Uint8Array) {
10667
+ bytes = input;
10668
+ } else {
10669
+ bytes = new TextEncoder().encode(input);
10670
+ }
10671
+ const CHUNK = 8192;
10663
10672
  let binary = "";
10664
- const bytes = new TextEncoder().encode(input);
10665
- const len = bytes.length;
10666
- for (let i = 0;i < len; i++) {
10667
- binary += String.fromCharCode(bytes[i]);
10673
+ for (let i = 0;i < bytes.length; i += CHUNK) {
10674
+ binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + CHUNK)));
10668
10675
  }
10669
10676
  let base64 = btoa(binary);
10670
10677
  if (urlSafe) {
@@ -12826,4 +12833,4 @@ function registerCoreExtensions(expression) {
12826
12833
  return expression;
12827
12834
  }
12828
12835
 
12829
- //# debugId=3837C001D4B080B364756E2164756E21
12836
+ //# debugId=24F246DE40EE806764756E2164756E21