propable-immutable
v0.1.2
Published
A collection of immutable.js prop types.
Downloads
1
Maintainers
Readme
Propable-Immutable
A collection of immutable.js prop types extending
propable
.
Installing / Getting Started
Install the package
npm install --save propable-immutable
and import/require it
import { propTypes } from 'propable-immutable';
// OR (pre ES6)
var propTypes = require('propable-immutable').propTypes;
Usage
const o = { key: 'value' };
propTypes.Map.test(o); // true
propTypes.Map.parse(o); // Map { key: 'value' }
propTypes.Map.parse(JSON.stringify(o)); // Map { key: 'value' }
propTypes.List.test(o); // false
Developing
This is what you do after you have cloned the repository:
npm install
npm run build
(Install dependencies & build the project.)
Linting
Execute ESLint
npm run lint
Try to automatically fix linting errors
npm run lint:fix
Testing
Execute Jest unit tests using
npm test
Tests are defined in the same directory the module lives in. They are specified in '[module].test.js' files.
Building
To build the project, execute
npm run build
This saves the production ready code into 'dist/'.