![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@react-awesome-query-builder/core
Advanced tools
This package has core functionality to import/export/store query, provides utils and core config. Can be used on server-side, does not require React.
npm i @react-awesome-query-builder/core --save
import {
CoreConfig, Utils,
// types
TreeStore, TreeState, TreeActions, InputAction, JsonTree
} from '@react-awesome-query-builder/core';
// config
const config = {
...CoreConfig,
fields: {
name: {
label: 'Name',
type: 'text',
},
age: {
label: 'Age',
type: 'number',
}
}
};
// load from JSON
const initialTree = Utils.loadTree({
id: '00001',
type: 'group',
children1: [
{
id: '00002',
type: 'rule',
properties: {
field: 'age',
operator: 'greater_or_equal',
value: [18],
valueSrc: ['value']
}
}
]
});
// or import from jsonLogic
// const initialTree = Utils.loadFromJsonLogic({
// 'and': [
// {
// '<=': [
// {var: 'age'},
// 18
// ]
// }
// ]
// }, config);
// create store to manipulate tree on backend
const reducer = TreeStore(config);
let state: TreeState = reducer({tree: initialTree});
// add rule `name == 'denis'`
const rootPath = [ state.tree.get('id') as string ];
const action = TreeActions.tree.addRule(config, rootPath, {
field: 'name',
operator: 'equal',
value: ['denis'],
valueSrc: ['value'],
valueType: ['text']
});
state = reducer(state, action);
// export
const tree = Utils.getTree(state.tree);
const { logic } = Utils.jsonLogicFormat(state.tree, config);
const sql = Utils.sqlFormat(state.tree, config);
const spel = Utils.sqlFormat(state.tree, config);
const mongo = Utils.mongodbFormat(state.tree, config);
const elastic = Utils.elasticSearchFormat(state.tree, config);
console.log({ tree, logic, sql, spel, mongo, elastic });
FAQs
User-friendly query builder for React. Core
The npm package @react-awesome-query-builder/core receives a total of 0 weekly downloads. As such, @react-awesome-query-builder/core popularity was classified as not popular.
We found that @react-awesome-query-builder/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.