Skip to content

hippich/map-table

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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

Stars

Watchers

Forks

Packages

No packages published