0.2.0 • Published 2 years ago

superstruct-extra v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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 for bigint.
  • args() - create args for the fn type.
  • nullish() - add support for null | undefined. This can also be used for void types when creating fn schema.
  • nonempty() - refine arrays, strings, tuples and maps to ensure they are nonempty.
  • email() - refine a string as an email - this comes with a special Email type based on annotating the string type.
  • uuid() - refine a string as a uuid.
  • readonly() - refine iterables and objects to be readonly. This doesn't perform any client side enforcement of readonly properties.
0.2.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago