Skip to content

Regex for UUID is wrong.Β #418

@TroyKomodo

Description

@TroyKomodo
> import { MongoClient, UUID } from "@db/mongo";
undefined
> UUID.createFromHexString("0192B4AE-79EF-418D-9FBE-C7529E22AF86".toLowerCase())
new UUID("0192b4ae-79ef-418d-9fbe-c7529e22af86")
> UUID.createFromHexString("0192B4AE-F8D4-B461-4C17-A188B212576D".toLowerCase())
Uncaught BSONError: UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
    at uuidHexStringToBuffer (https://jsr.io/@lucsoft/web-bson/0.3.1/mod.js:288:15)
    at Function.createFromHexString (https://jsr.io/@lucsoft/web-bson/0.3.1/mod.js:597:24)
    at <anonymous>:1:27
> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions