4 ms·
You can do it with template string types: https://ybogomolov.me/type-level-uuid https://ybogomolov.me/type-level-uuid
by n2d4 2y ago
You can do it with template string types: https://ybogomolov.me/type-level-uuid https://ybogomolov.me/type-level-uuid
- throwitaway1123 2y agoThe built in DOM types for the browser's `crypto.randomUUID` function actually already use this technique to a lesser extent: https://github.com/microsoft/TypeScript/blob/121c5dd36bd87e47a065ff7d6b220ce6d079075c/src/lib/dom.generated.d.ts#L5971 https://github.com/microsoft/TypeScript/blob/121c5dd36bd87e4...