Gathering detailed insights and metrics for @mkontsek/json-logic-js-graphql
Gathering detailed insights and metrics for @mkontsek/json-logic-js-graphql
Gathering detailed insights and metrics for @mkontsek/json-logic-js-graphql
Gathering detailed insights and metrics for @mkontsek/json-logic-js-graphql
json-logic-js support for GraphQL Query keys
npm install @mkontsek/json-logic-js-graphql
Typescript
Module System
Node Version
NPM Version
TypeScript (70.41%)
JavaScript (29.59%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
36 Commits
1 Forks
3 Watchers
1 Branches
2 Contributors
Updated on Dec 15, 2022
Latest Version
2.0.7
Package Id
@mkontsek/json-logic-js-graphql@2.0.7
Unpacked Size
213.68 kB
Size
65.51 kB
File Count
15
NPM Version
8.5.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
23
Exposes immutable useful functions from Lodash to jsonLogic
Unsupported GraphQL keys: ==
, ===
, !=
, !==
, >
, >=
, <
, <=
, !!
, !
, %
, +
, *
, -
, /
Use any of _eq
, _gt
, _gte
, _lt
, _lte
etc from Lodash methods
1# Yarn 2$ yarn add json-logic-js-graphql 3 4# NPM 5$ npm install json-logic-js-graphql --save
1 2import { jsonLogic } from 'json-logic-js-graphql' 3 4const rules = { 5 _eq: [{ var: 'foo' }, { var: 'bar' }], 6} 7const data = { foo: 'bar', bar: 'bar' } 8 9jsonLogic.apply(rules, data) 10
jsonLogic's equal operator is "==="
so it can't be used as a GraphQL key.
We expose the eq
lodash method as _eq
to jsonLogic.
1mutation { 2 updateResource( 3 id: "609ce9dbec9fb60004087784" 4 logic: { _eq: [{ var: "foo" }, "bar"] } 5 ) { 6 id 7 } 8} 9
All Lodash methods exposed with the
_
namespace to avoid overwriting the default jsonLogic's functionality
_gteDate
, _gtDate
, _lteDate
, _ltDate
, _eqDate
, _getDate
example:
1const rules = { 2 _gteDate: [ 3 [{ var: 'from' }, { var: 'to' }], 4 [364, 'days'], 5 ], 6} 7const data = { from: '2020-10-01', to: '2021-10-01' } 8 9jsonLogic.apply(rules, data) 10
Can be found here:
Install dependencies with yarn install
and then run the tests yarn test
Inpired from formio utils
Bug reports and pull requests are welcome on GitHub at https://github.com/msroot/json-logic-js-graphql. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The library is available as open source under the terms of the MIT License.
Everyone interacting in the json-logic-js-graphql project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 1/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More