Branded ID type constructor function
ID<"myTable"> from a string—when serializing the ID to the DOM, e.g. as the value attribute of a <select> element. The example in my code, snipped verbatim:Perhaps it would be nice, for scenarios like these, to offer a function which tries to create a branded string by validating that the string is the correct format (length/content) for a Convex ID? I guess that would just mean validating that it's a UUID (v4). Something like:
Of course I can coerce the string to the type I'd like, but this alternative could be nicer. Just a data point and a thought
