-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I came across this library while searching for just this functionality. Thanks for sharing it.
I was wondering whether it would be possible to kind of reverse engineer and determine the parameter values given a resultant json.
Let me give an example to clarify what I am seeking:
Suppose the template is defined as
const template = parse("{
title: 'Fixed Title",
{foo:baz}
}");
And passing a foo value generates the json
console.log(template({foo: 'baz'}) // prints {title:'Fixed Title', foo: 'baz'}
But is there a way to get the params given the resultant json. I am using a function called extract as an example to explain what will be useful
console.log(template.extract({title: 'Fixed Title', foo: 'baq'}) // prints {foo: 'baq'}
Thanks
Metadata
Metadata
Assignees
Labels
No labels