You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// use a brand to create a tagged type. Horrible hack but best we can doexporttypeUUID=string&{__uuid: void};// uuid regexconstUUID_REGEX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;// type guard to assert a string is a valid uuidexportfunctionisUUID(uuid: string): uuid is UUID{returnUUID_REGEX.test(uuid);}
Additional information
No response
The text was updated successfully, but these errors were encountered:
When it comes to dedicated "UUID" types, different projects are going to have differing needs. Deciding what the properties of such a type should / should not be and how it's used is a can of worms I have zero interest in dealing with.
Feature description
Hi and thanks for your package.
I think it will be nice to have uuid type declaration or a class to be able to use it in TypeScript
something like described here: https://stackoverflow.com/a/75962201/3730048
Additional information
No response
The text was updated successfully, but these errors were encountered: