UNPKG

json-from-template

Version:

Generate random JSON(plain old object) from the given template

12 lines (8 loc) 244 B
'use strict'; var compiler = null; exports.injectCompiler = function (_compiler) { compiler = _compiler; }; exports.handle = function (rule, fn, helpers, data, path) { return compiler.compile(rule.raw, fn(data), helpers, data, path); };