validate-table-rules

    1.0.2 • Public • Published

    This package allows you to convert string expressions into actual expressions.

    I am actively working on building this to handle a mass range of possible expressions.

    Installation

    npm install validate-table-rules
    

    Require the module.

    'use strict';
    const ruleSet = require('validate-table-rules');
    

    You must attach the module to the object prototype.

    Object.prototype.rule = ruleSet.rules;
    

    Sample use case

    console.log(object.rule('[Age] < [Required]'))
    

    To list the set of available expressions

    console.log(object.rule('--help'))
    

    Quickstart

    'use strict';
    
    //  Required module
    const ruleSet = require('validate-table-rules');
    
    // Attach module to Object prototype
    Object.prototype.rule = ruleSet.rules;
    
    // Declare and object
    const object = [
        {Age: 18, Required: 21}
    ];
    
    // Sample case -> pass in names you
    // want to check for in attached object
    console.log(object.rule('[Age] < [Required]'))
    
    

    Install

    npm i validate-table-rules

    DownloadsWeekly Downloads

    0

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    3.76 kB

    Total Files

    3

    Last publish

    Collaborators

    • christoper.bradley