From 1616ceed9578b1af58cc28a9f1bd74365b17ef19 Mon Sep 17 00:00:00 2001 From: tate Date: Tue, 5 Sep 2023 10:25:28 +1000 Subject: [PATCH] export display/internal contenthash codec --- packages/ensjs/src/utils/contentHash.ts | 4 ++-- packages/ensjs/src/utils/index.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ensjs/src/utils/contentHash.ts b/packages/ensjs/src/utils/contentHash.ts index cb536713..18778913 100644 --- a/packages/ensjs/src/utils/contentHash.ts +++ b/packages/ensjs/src/utils/contentHash.ts @@ -30,7 +30,7 @@ function matchProtocol(text: string) { ) } -const getDisplayCodec = (encoded: string): ProtocolType => { +export const getDisplayCodec = (encoded: string): ProtocolType => { const codec = getCodec(encoded) switch (codec) { case 'ipfs': @@ -49,7 +49,7 @@ const getDisplayCodec = (encoded: string): ProtocolType => { } } -const getInternalCodec = ( +export const getInternalCodec = ( displayCodec: NonNullable, ): InternalCodec => { switch (displayCodec) { diff --git a/packages/ensjs/src/utils/index.ts b/packages/ensjs/src/utils/index.ts index 914df375..d1615267 100644 --- a/packages/ensjs/src/utils/index.ts +++ b/packages/ensjs/src/utils/index.ts @@ -67,6 +67,8 @@ export { export { decodeContentHash, encodeContentHash, + getDisplayCodec, + getInternalCodec, getProtocolType, isValidContentHash, type DecodedContentHash,