forked from Agoric/agoric-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): patch cosmjs-types for vat compatibility
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => { |