0.5.2 • Published 8 years ago

immutable-schema v0.5.2

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

immutable-js-schema

npm Build Status Document Dependencies

Schema validator for immutable-js structures

Getting Started

npm install immutable-schema

Then,

import {
    ListSchema, FixedListSchema, MapSchema, Exactly, OneOf
} from 'immutable-schema';

Examples

const schema = FixedListSchema(isString, isNumber, Exactly('greetings'));
const list = List.of('hi', 14.5, 'greetings');
assert.ok(schema(list));
const schema = MapSchema(
    isString, isNumber,
    v => isNumber(v) && (v % 2 === 0), isString
);

assert.ok(schema(
    Map().set('hi', 5).set(14, 'roar')
));
0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago