UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

1 lines 770 B
{"version":3,"sources":["../../../../src/lib/resolvers/hyperlink.ts"],"names":[],"mappings":";;;;;AAIO,SAAS,iBAAiB,SAAoE,EAAA;AACpG,EAAA,MAAM,SAAS,MAAO,CAAA,IAAA,CAAK,MAAM,IAAI,GAAA,CAAI,SAAS,CAAC,CAAA;AACnD,EAAA,OAAO,MAAO,CAAA,MAAA,CAAO,MAAM,WAAA,CAAY,sBAAsB,CAAA;AAC9D;AAHgB,MAAA,CAAA,gBAAA,EAAA,kBAAA,CAAA","file":"hyperlink.mjs","sourcesContent":["import { Result } from '@sapphire/result';\nimport { URL } from 'node:url';\nimport { Identifiers } from '../errors/Identifiers';\n\nexport function resolveHyperlink(parameter: string): Result<URL, Identifiers.ArgumentHyperlinkError> {\n\tconst result = Result.from(() => new URL(parameter));\n\treturn result.mapErr(() => Identifiers.ArgumentHyperlinkError) as Result<URL, Identifiers.ArgumentHyperlinkError>;\n}\n"]}