0.1.3 • Published 9 years ago

immodel-types v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

immodel-types

Adds type registration to immodel

Usage

type

Registers a type. It may be used in two ways, at the end of a chain:

model
  .validator(isString)
  .caster(toString)
  .type('string');

In which case it registers the this in the current chain as the type string. And alternatively, with a function that takes a model and returns a type:

model
  .type('string', function(model) {
    return model
      .validator(isString)
      .caster(toString);
  });

The second method should be used by plugins that are registering types.

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago