@httpx/assert
Version:
Assertions and typeguards
1 lines • 883 B
Source Map (JSON)
{"version":3,"sources":["../src/uuid.helpers.ts"],"names":["getUuidVersion","uuid","v","uuidSupportedVersions"],"mappings":"qDAMO,IAAMA,CAAAA,CAAkBC,CAAAA,EAAqC,CAClE,GAAI,OAAOA,CAAAA,EAAS,QAAA,CAClB,OAAO,KAET,IAAMC,CAAAA,CAAI,MAAA,CAAO,QAAA,CAASD,CAAAA,CAAK,KAAA,CAAM,EAAA,CAAI,EAAE,CAAA,CAAG,EAAE,CAAA,CAChD,OAAIE,qBAAAA,CAAsB,GAAA,CAAID,CAAC,CAAA,CACtBA,EAEF,IACT","file":"uuid.helpers.mjs","sourcesContent":["import type { UuidVersion } from './uuid.types';\nimport { uuidSupportedVersions } from './uuid.utils';\n\n/**\n * Adapted from https://github.com/uuidjs/uuid/blob/main/src/version.js\n */\nexport const getUuidVersion = (uuid: string): UuidVersion | null => {\n if (typeof uuid !== 'string') {\n return null;\n }\n const v = Number.parseInt(uuid.slice(14, 15), 16);\n if (uuidSupportedVersions.has(v)) {\n return v as UuidVersion;\n }\n return null;\n};\n"]}