UNPKG

@hazae41/base58

Version:

Base58 adapter for WebAssembly and JS implementations

1 lines 739 B
{"version":3,"file":"adapter.mjs","sources":["../../../../../src/mods/base58/adapter.ts"],"sourcesContent":["import { None, Nullable, Option } from \"@hazae41/option\"\nimport { BytesOrCopiable, Copiable } from \"libs/copiable/index.js\"\n\nlet global: Option<Adapter> = new None()\n\nexport function get() {\n return global\n}\n\nexport function set(value: Nullable<Adapter>) {\n global = Option.wrap(value)\n}\n\nexport interface Adapter {\n encodeOrThrow(bytes: BytesOrCopiable): string\n decodeOrThrow(text: string): Copiable\n}\n\n"],"names":[],"mappings":";;AAGA,IAAI,MAAM,GAAoB,IAAI,IAAI,EAAE;SAExB,GAAG,GAAA;AACjB,IAAA,OAAO,MAAM;AACf;AAEM,SAAU,GAAG,CAAC,KAAwB,EAAA;AAC1C,IAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B;;;;"}