Skip to content

Commit 2968cd9

Browse files
committed
Use Symbol.for in case there are multiple instances of the package
1 parent fac4927 commit 2968cd9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

constants.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @ts-check
22
'use strict'
33

4-
export const Sync = Symbol('_sync')
5-
export const Override = Symbol('_override')
6-
export const EfficientTop = Symbol('_efficientTop')
4+
export const Sync = Symbol.for('json_logic_sync')
5+
export const Override = Symbol.for('json_logic_override')
6+
export const EfficientTop = Symbol.for('json_logic_efficientTop')
77
export const isSync = (x) => Boolean(typeof x !== 'function' || x[Sync])
88
export default {
99
Sync,

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-logic-engine",
3-
"version": "1.2.7",
3+
"version": "1.2.8",
44
"description": "Construct complex rules with JSON & process them.",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",
@@ -53,6 +53,8 @@
5353
"json",
5454
"logic",
5555
"jsonlogic",
56-
"rules"
56+
"rules",
57+
"sandbox",
58+
"engine"
5759
]
5860
}

0 commit comments

Comments
 (0)