0.2.0 • Published 4 years ago
superstruct-extra v0.2.0
superstruct-extra
Extra types, refinements and coercions for
superstruct.
Reason
Superstruct is a great library, but sometimes you need additional types.
This re-exports superstruct as well as the following additions.
promise()- for adding promise values which can be verified.fn()- for typed function declarations.bigint()- add support forbigint.args()- create args for thefntype.nullish()- add support fornull | undefined. This can also be used forvoidtypes when creatingfnschema.nonempty()- refine arrays, strings, tuples and maps to ensure they are nonempty.email()- refine a string as an email - this comes with a specialEmailtype based on annotating the string type.uuid()- refine a string as a uuid.readonly()- refine iterables and objects to bereadonly. This doesn't perform any client side enforcement of readonly properties.