dependent-types

0.0.3 • Public • Published

Dependent types library

const StringBased = require('dependent-types/string-based');
const Line = StringBased.create({
    singleLine: true,
}, 'Line');
 
const line = new Line('some text');
line.validate(); // true
const StringBased = require('dependent-types/string-based');
const Email = StringBased.create({
    regexp: /^[a-zA-Z0-9\._\-]+@[a-zA-Z0-9\._\-]+\.[a-zA-Z0-9\._\-]+$/,
}, 'Email');
 
const email = new Email('email@example.com');
email.validate(); // true

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i dependent-types

    Weekly Downloads

    1

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • abramov