UNPKG

@hazae41/base64

Version:

Base64 adapter for WebAssembly and JS implementations

1 lines 931 B
{"version":3,"file":"adapter.mjs","sources":["../../../../../src/mods/base64/adapter.ts"],"sourcesContent":["import { Nullable, Option, Some } from \"@hazae41/option\"\nimport { BytesOrCopiable, Copiable } from \"libs/copiable/index.js\"\nimport { fromBuffer } from \"./buffer.js\"\n\nlet global: Option<Adapter> = new Some(fromBuffer())\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 encodePaddedOrThrow(bytes: BytesOrCopiable): string\n decodePaddedOrThrow(text: string): Copiable\n\n encodeUnpaddedOrThrow(bytes: BytesOrCopiable): string\n decodeUnpaddedOrThrow(text: string): Copiable\n}\n\n"],"names":[],"mappings":";;;AAIA,IAAI,MAAM,GAAoB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;SAEpC,GAAG,GAAA;AACjB,IAAA,OAAO,MAAM;AACf;AAEM,SAAU,GAAG,CAAC,KAAwB,EAAA;AAC1C,IAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B;;;;"}