From b9b1029bdd23b786cfde688ade302e5dd57fe5b8 Mon Sep 17 00:00:00 2001 From: lenkan Date: Wed, 14 Feb 2024 16:30:41 +0100 Subject: [PATCH] fix: remove window.Buffer assignment --- src/buffer-polyfill.ts | 5 ----- src/index.ts | 1 - src/keri/core/bexter.ts | 1 + src/keri/core/diger.ts | 2 +- src/keri/core/prefixer.ts | 2 +- src/keri/core/saider.ts | 2 +- 6 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 src/buffer-polyfill.ts diff --git a/src/buffer-polyfill.ts b/src/buffer-polyfill.ts deleted file mode 100644 index 7e3a6f00..00000000 --- a/src/buffer-polyfill.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Buffer } from 'buffer'; - -try { - window.Buffer = Buffer; -} catch (e) {} diff --git a/src/index.ts b/src/index.ts index 99e284bb..122d03b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ -import './buffer-polyfill'; import * as exp from './exports'; export * from './exports'; export default exp; diff --git a/src/keri/core/bexter.ts b/src/keri/core/bexter.ts index bf1abfcb..9be0983f 100644 --- a/src/keri/core/bexter.ts +++ b/src/keri/core/bexter.ts @@ -1,6 +1,7 @@ import { BexDex, Matter, MatterArgs, MtrDex } from './matter'; import { EmptyMaterialError } from './kering'; import Base64 from 'urlsafe-base64'; +import { Buffer } from 'buffer'; const B64REX = '^[A-Za-z0-9\\-_]*$'; export const Reb64 = new RegExp(B64REX); diff --git a/src/keri/core/diger.ts b/src/keri/core/diger.ts index 8bcbfb22..2e5a32f7 100644 --- a/src/keri/core/diger.ts +++ b/src/keri/core/diger.ts @@ -1,5 +1,5 @@ import { blake3 } from '@noble/hashes/blake3'; - +import { Buffer } from 'buffer'; import { Matter, MatterArgs, MtrDex } from './matter'; /** diff --git a/src/keri/core/prefixer.ts b/src/keri/core/prefixer.ts index 09b99ccb..b2e9faff 100644 --- a/src/keri/core/prefixer.ts +++ b/src/keri/core/prefixer.ts @@ -3,7 +3,7 @@ import { EmptyMaterialError } from './kering'; import { Dict, Ilks } from './core'; import { sizeify } from './serder'; import { Verfer } from './verfer'; - +import { Buffer } from 'buffer'; import { blake3 } from '@noble/hashes/blake3'; const Dummy: string = '#'; diff --git a/src/keri/core/saider.ts b/src/keri/core/saider.ts index d2e55d90..306e228b 100644 --- a/src/keri/core/saider.ts +++ b/src/keri/core/saider.ts @@ -2,7 +2,7 @@ import { DigiDex, Matter, MatterArgs, MtrDex } from './matter'; import { deversify, Dict, Serials } from './core'; import { EmptyMaterialError } from './kering'; import { dumps, sizeify } from './serder'; - +import { Buffer } from 'buffer'; import { blake3 } from '@noble/hashes/blake3'; const Dummy = '#';