Skip to content

Commit

Permalink
Use Symbol.for in case there are multiple instances of the package
Browse files Browse the repository at this point in the history
  • Loading branch information
TotalTechGeek committed Jul 24, 2023
1 parent fac4927 commit 2968cd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check
'use strict'

export const Sync = Symbol('_sync')
export const Override = Symbol('_override')
export const EfficientTop = Symbol('_efficientTop')
export const Sync = Symbol.for('json_logic_sync')
export const Override = Symbol.for('json_logic_override')
export const EfficientTop = Symbol.for('json_logic_efficientTop')
export const isSync = (x) => Boolean(typeof x !== 'function' || x[Sync])
export default {
Sync,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-logic-engine",
"version": "1.2.7",
"version": "1.2.8",
"description": "Construct complex rules with JSON & process them.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -53,6 +53,8 @@
"json",
"logic",
"jsonlogic",
"rules"
"rules",
"sandbox",
"engine"
]
}

0 comments on commit 2968cd9

Please sign in to comment.