Skip to content

Commit

Permalink
chore(deps): patch cosmjs-types for vat compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 6, 2024
1 parent ba5cbdb commit 11f41ab
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions patches/cosmjs-types+0.9.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/node_modules/cosmjs-types/helpers.js b/node_modules/cosmjs-types/helpers.js
index 3bd449c..8a436bf 100644
--- a/node_modules/cosmjs-types/helpers.js
+++ b/node_modules/cosmjs-types/helpers.js
@@ -7,7 +7,7 @@
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromJsonTimestamp = exports.fromTimestamp = exports.toTimestamp = exports.setPaginationParams = exports.isObject = exports.isSet = exports.fromDuration = exports.toDuration = exports.omitDefault = exports.base64FromBytes = exports.bytesFromBase64 = void 0;
-var globalThis = (() => {
+var localGlobal = (() => {
if (typeof globalThis !== "undefined")
return globalThis;
if (typeof self !== "undefined")
@@ -16,9 +16,9 @@ var globalThis = (() => {
return window;
if (typeof global !== "undefined")
return global;
- throw "Unable to locate global object";
+ throw "Unable to locate global object in cosmjs-types";
})();
-const atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
+const atob = localGlobal.atob || ((b64) => localGlobal.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64) {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@@ -28,7 +28,7 @@ function bytesFromBase64(b64) {
return arr;
}
exports.bytesFromBase64 = bytesFromBase64;
-const btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
+const btoa = localGlobal.btoa || ((bin) => localGlobal.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr) {
const bin = [];
arr.forEach((byte) => {

0 comments on commit 11f41ab

Please sign in to comment.