@o3/prop-types

0.0.2 • Public • Published

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 to type.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.

Readme

Keywords

Package Sidebar

Install

npm i @o3/prop-types

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

20.1 kB

Total Files

6

Last publish

Collaborators

  • flynnham