@o3/prop-types v0.0.2
js-prop-types (experimental)
An environment agnostic reworking of Facebook's React prop-types implementation.
This package is intended to be used with @o3/typed, as a complementary abstract type checking tool.
What it does
This implementation allows type validation via thrown Type exceptions, which is useful for type checking on primitive values outside of a React/Browser environment.
Significant deviations from the original source
Removed environment safe-guards to enable exception bubbling for type errors.
Converted
type.isRequired
totype.isOptional
to assume that all type checks assume a value to be provided by default (and to throw if otherwise).Removal of unneeded React component support (since it's being used to validate primitive values).
WIP Replacement of ES5 compliant code and shims with their ES2015+ equivalents.
Removal of unneeded files and old build process.
6 years ago