Giter Club home page Giter Club logo

ml-check's Introduction

ml-check

Build Status npm version Test Coverage

An isomorphic, runtime, type checking utility that can be used on the server or in the client. Check was extracted from the Meteor framework, and has had some features added and been given full test coverage. It is used in the reactive framework milojs It allows to both document and to check parameter types in your function making code both readable and stable.

Usage

var check = milo.check
    , Match = check.Match;

function My(name, obj, cb) {
    // if any of checks fail an error will be thrown
    check(name, String);
    check(obj, Match.ObjectIncluding({ options: Object }));
    check(cb, Function);

    // ... your code
}

See Meteor docs to see how it works

Patterns

All patterns and functions described in Meteor docs work.

Unlike in Meteor, Object pattern matches instance of any class, not only plain object.

In addition to patterns described in Meteor docs the following patterns are implemented

Match.ObjectHash(pattern)

Matches an object where all properties match a given pattern

Match.Subclass(constructor [, matchThisClassToo])

Matches a class that is a subclass of a given class. If the second parameter is true, it will also match the class itself.

Without this pattern to check if MySubclass is a subclass of MyClass you would have to use

check(MySubclass, Match.Where(function() {
   return MySubclass.prototype instanceof MyClass;
});

Things we explicitly do NOT support:

  • heterogenous arrays

ml-check's People

Contributors

epoberezkin avatar jasoniangreen avatar danielzurawski avatar greenkeeperio-bot avatar

Stargazers

 avatar

Watchers

James Cloos avatar

ml-check's Issues

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.create:3.1.1

Vulnerabilities

DepShield reports that this application's usage of lodash.create:3.1.1 results in the following vulnerability(s):


Occurrences

lodash.create:3.1.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.5) Vulnerability due to usage of debug:2.6.8

Vulnerabilities

DepShield reports that this application's usage of debug:2.6.8 results in the following vulnerability(s):


Occurrences

debug:2.6.8 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ debug:2.6.8

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._basecopy:3.0.1

Vulnerabilities

DepShield reports that this application's usage of lodash._basecopy:3.0.1 results in the following vulnerability(s):


Occurrences

lodash._basecopy:3.0.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash._basecopy:3.0.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._isiterateecall:3.0.9

Vulnerabilities

DepShield reports that this application's usage of lodash._isiterateecall:3.0.9 results in the following vulnerability(s):


Occurrences

lodash._isiterateecall:3.0.9 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._isiterateecall:3.0.9

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._baseassign:3.2.0

Vulnerabilities

DepShield reports that this application's usage of lodash._baseassign:3.2.0 results in the following vulnerability(s):


Occurrences

lodash._baseassign:3.2.0 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.isarray:3.0.4

Vulnerabilities

DepShield reports that this application's usage of lodash.isarray:3.0.4 results in the following vulnerability(s):


Occurrences

lodash.isarray:3.0.4 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash.isarray:3.0.4

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._basecreate:3.0.3

Vulnerabilities

DepShield reports that this application's usage of lodash._basecreate:3.0.3 results in the following vulnerability(s):


Occurrences

lodash._basecreate:3.0.3 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._basecreate:3.0.3

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 8.8) Vulnerability due to usage of growl:1.9.2

Vulnerabilities

DepShield reports that this application's usage of growl:1.9.2 results in the following vulnerability(s):


Occurrences

growl:1.9.2 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ growl:1.9.2

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.keys:3.1.2

Vulnerabilities

DepShield reports that this application's usage of lodash.keys:3.1.2 results in the following vulnerability(s):


Occurrences

lodash.keys:3.1.2 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.5) Vulnerability due to usage of mocha:3.5.3

Vulnerabilities

DepShield reports that this application's usage of mocha:3.5.3 results in the following vulnerability(s):

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash._getnative:3.9.1

Vulnerabilities

DepShield reports that this application's usage of lodash._getnative:3.9.1 results in the following vulnerability(s):


Occurrences

lodash._getnative:3.9.1 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash._getnative:3.9.1

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.isarguments:3.1.0

Vulnerabilities

DepShield reports that this application's usage of lodash.isarguments:3.1.0 results in the following vulnerability(s):


Occurrences

lodash.isarguments:3.1.0 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ lodash.create:3.1.1
              └─ lodash._baseassign:3.2.0
                    └─ lodash.keys:3.1.2
                          └─ lodash.isarguments:3.1.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

[DepShield] (CVSS 8.8) Vulnerability due to usage of minimist:0.0.8

Vulnerabilities

DepShield reports that this application's usage of minimist:0.0.8 results in the following vulnerability(s):


Occurrences

minimist:0.0.8 is a transitive dependency introduced by the following direct dependency(s):

mocha:3.5.3
        └─ mkdirp:0.5.1
              └─ minimist:0.0.8

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.