soluto / tweek.jpad Goto Github PK
View Code? Open in Web Editor NEWJPad is the default rules engine for Tweek.
License: MIT License
JPad is the default rules engine for Tweek.
License: MIT License
context data:
{
"object": {"hello": "world"},
"array": ["abcd", "efgh"],
"complex" : [{list:[{item:"abcd"}]}]
}
example (object):
{
"partitions": [],
"valueType": "bool",
"rules": [
{
"Matcher": {
"object.hello": "world"
},
"Value": true,
"Type": "SingleVariant"
}
],
"defaultValue": "default_value"
}
example (array):
{
"partitions": [],
"valueType": "bool",
"rules": [
{
"Matcher": {
"array[_]" : "abcd"
},
"Value": "true",
"Type": "SingleVariant"
}
],
"defaultValue": "true"
}
example (complex)
can be combined:
{
"partitions": [],
"valueType": "bool",
"rules": [
{
"Matcher": {
"complex[_].list[_].item" : "abcd"
},
"Value": "true",
"Type": "SingleVariant"
}
],
"defaultValue": "true"
}
Add support for contain operator for arrays. (contain one or more items)
It less ambitious than #22 and solve most user complaints
Add support to get JPad rules total count when passing JPad file or providing JPad url.
Suggested solution:
NPM client that will provide some utils functionality for JPad files.
For example, context has the value true, matcher has the value "true', the result is false.
The other way around - matcher has the value true, context has the value "true" returns true
We should be able to support a matcher like:
{
"SomeDate": {
"$ge": '01/01/2011'
"$compare": "date"
}
}
It can work in a similar way to custom comparer mechanism
Probably should be something like:
Null eq None/Null -> True
Null neq None/Null -> False
Any neq None/Null -> True
Any AnyOp None/Null -> False
A bit like undefined comparison in js
Should be in flag to support backward compatability
image - microsoft/dotnet:1.1.2-runtime
It'll be an interesting experiment to create a compiler that compiles the JPad AST to LLVM IR.
Split parser and compiler components.
Currently, the JPad json format support only strings in multi-variant weighted keys.
Allow new syntax for supporting other Json values:
current
{
args: {
a:40,
b:60
}
}
Suggested new additional syntax:
{
args: [{
value: 5
weight: 40
},
{
value: 10,
weight:60
}]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.