0.2.2 • Published 10 years ago

facts v0.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Some initial work to a bigger picture, still needs quite a bit of work

TODO

  • Typed Arrays
  • Multiple length arrays

Install

$ npm install facts

Basic Usage

  // import shape and types you want
  import {
    shape,
    STRING,
    NUMBER
  } from "facts"

  shape("bob", "bob")                               // true
  shape(STRING, "bob")                              // true
  shape(STRING, 5)                                  // false
  shape(1, 1)                                       // true
  shape(NUMBER, 5)                                  // true
  shape(NUMBER, "bob")                              // false
  shape([1,2,3], [1,2,3])                           // true
  shape([1,"bob",3], [[1,2,3]])                     // false
  shapw(["ok", NUMBER], ["ok", 5])                  // true
  shapw(["ok", NUMBER], ["ok", "bob"])              // false
  shape(ARRAY, [])                                  // true
  shape(ARRAY, [1,2,3])                             // true
  shape({foo: [1,2,3]}, {foo: [NUMBER, NUMBER, 3]}) // true

License

facts is Copyright (c) 2015 James Hunter @cccc00 and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago