@ondc/automation-mock-runner 1.3.52 → 1.3.53

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.
@@ -617,11 +617,19 @@ class MockRunner {
617
617
  }
618
618
  static encodeBase64(input) {
619
619
  const bytes = new TextEncoder().encode(input);
620
- return btoa(String.fromCharCode(...bytes));
620
+ const CHUNK = 0x8000;
621
+ let binary = "";
622
+ for (let i = 0; i < bytes.length; i += CHUNK) {
623
+ binary += String.fromCharCode.apply(null, bytes.subarray(i, i + CHUNK));
624
+ }
625
+ return btoa(binary);
621
626
  }
622
627
  static decodeBase64(encoded) {
623
628
  const binaryString = atob(encoded);
624
- const bytes = new Uint8Array([...binaryString].map((char) => char.charCodeAt(0)));
629
+ const bytes = new Uint8Array(binaryString.length);
630
+ for (let i = 0; i < binaryString.length; i++) {
631
+ bytes[i] = binaryString.charCodeAt(i);
632
+ }
625
633
  return new TextDecoder().decode(bytes);
626
634
  }
627
635
  static resolveBaseActionId(actionId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ondc/automation-mock-runner",
3
- "version": "1.3.52",
3
+ "version": "1.3.53",
4
4
  "description": "A TypeScript library for ONDC automation mock runner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",