superstruct-extra
v0.2.0
Published
Extra types, refinements and coersions for superstruct.
Downloads
21
Readme
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 thefn
type.nullish()
- add support fornull | undefined
. This can also be used forvoid
types when creatingfn
schema.nonempty()
- refine arrays, strings, tuples and maps to ensure they are nonempty.email()
- refine a string as an email - this comes with a specialEmail
type 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.