Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Rules engine based on map table approach

It allows you to setup simple rules set based on the table design. This in turn allows you to use spreadsheets as a configuration tool.

Example:

var MapTable = require('map-table');

var map = new MapTable([
  ['id', 'x', 'y'],
  ['1' , '1', 'a'],
  ['2' , '2', 'b']
  ['3' , '2', null]
]);

console.log(map.match({ x: '1', y: 'a' }).id); // outputs '1'
console.log(map.match({ x: '2', y: 'xyz' })); // outputs '3'

About

Maps object to a single value based on rules defined as a array/table

Resources

Packages

No packages published
You can’t perform that action at this time.