mirror of
https://github.com/pezkuwichain/pezkuwi-api.git
synced 2026-04-22 03:17:56 +00:00
31467f90d4
- @pezkuwi/papi-utils (rebrand of @polkadot-api/utils) - @pezkuwi/bizinikiwi-bindings (rebrand of @polkadot-api/substrate-bindings) - @pezkuwi/metadata-builders (rebrand of @polkadot-api/metadata-builders) - @pezkuwi/merkleize-metadata (rebrand of @polkadot-api/merkleize-metadata) All @polkadot-api references replaced with @pezkuwi equivalents.
1 line
1.4 KiB
Plaintext
1 line
1.4 KiB
Plaintext
{"version":3,"file":"Self.mjs","sources":["../../../../src/codecs/scale/Self.ts"],"sourcesContent":["import { Codec, Decoder, Encoder, createCodec, _void } from \"scale-ts\"\n\nexport const selfEncoder = <T>(value: () => Encoder<T>): Encoder<T> => {\n let cache: Encoder<T> = (x) => {\n const encoder = value()\n cache = encoder\n return encoder(x)\n }\n\n return (x) => cache(x)\n}\n\nexport const selfDecoder = <T>(value: () => Decoder<T>): Decoder<T> => {\n let cache: Decoder<T> = (x) => {\n const decoder = value()\n const result = decoder\n cache = decoder\n return result(x)\n }\n\n return (x) => cache(x)\n}\n\nexport const Self = <T>(value: () => Codec<T>): Codec<T> =>\n createCodec(\n selfEncoder(() => value().enc),\n selfDecoder(() => value().dec),\n )\n"],"names":[],"mappings":";;AAEO,MAAM,WAAA,GAAc,CAAI,KAAA,KAAwC;AACrE,EAAA,IAAI,KAAA,GAAoB,CAAC,CAAA,KAAM;AAC7B,IAAA,MAAM,UAAU,KAAA,EAAM;AACtB,IAAA,KAAA,GAAQ,OAAA;AACR,IAAA,OAAO,QAAQ,CAAC,CAAA;AAAA,EAClB,CAAA;AAEA,EAAA,OAAO,CAAC,CAAA,KAAM,KAAA,CAAM,CAAC,CAAA;AACvB;AAEO,MAAM,WAAA,GAAc,CAAI,KAAA,KAAwC;AACrE,EAAA,IAAI,KAAA,GAAoB,CAAC,CAAA,KAAM;AAC7B,IAAA,MAAM,UAAU,KAAA,EAAM;AACtB,IAAA,MAAM,MAAA,GAAS,OAAA;AACf,IAAA,KAAA,GAAQ,OAAA;AACR,IAAA,OAAO,OAAO,CAAC,CAAA;AAAA,EACjB,CAAA;AAEA,EAAA,OAAO,CAAC,CAAA,KAAM,KAAA,CAAM,CAAC,CAAA;AACvB;AAEO,MAAM,IAAA,GAAO,CAAI,KAAA,KACtB,WAAA;AAAA,EACE,WAAA,CAAY,MAAM,KAAA,EAAM,CAAE,GAAG,CAAA;AAAA,EAC7B,WAAA,CAAY,MAAM,KAAA,EAAM,CAAE,GAAG;AAC/B;;;;"} |