Maps object to a single value based on rules defined as a array/table
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
docs
src
tests
.eslintrc
.gitignore
.travis.yml
Gruntfile.js
README.md
bower.json
package.json
testem.json
tests.setup.js

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'