0.0.6 • Published 9 years ago
linear-dsl v0.0.6
linear-dsl
For building custom DSLs.
Setup
$ npm install --save linear-dsl
Usage
Parsing custom DSL query.
const dsl = require('linear-dsl');
let data = dsl.parse('a(foo) AND b(2 bars) OR c(4)');
Validating query mapping.
const a = true;
const b = (args => /[a-z]/i.test(args[0]));
const c = {args =>};
const mapping = {a, b, c};
dsl.mappsTo('a(foo) AND b(2 bars) OR c(4)', mapping);