StorageId branded type and validator
It would be cool if
StorageId
were a branded type (like Id
) rather than just a type alias, and it would also be cool if there were a validator for storage IDs (e.g. v.storageId()
).3 Replies
You're prescient, work with this as a side effect is underway
This was done in a previous release, for anyone following up.
I also realized this just works:
field
will be typed as MyStringType
and give you errors on functions like withIndex
, and give you that type on returned documents.To clarify, we now have
Id<"_storage">
which can be used in place of storage IDs. Similarly v.id("_storage")
works.