New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

facts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facts

Declarative Argument Invaraints

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

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.

Keywords

invariant

FAQs

Package last updated on 12 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts