Skip to content

Commit 709e8e0

Browse files
committed
Correct some empty object checks
1 parent b485233 commit 709e8e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

defaultMethods.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function isDeterministic (method, engine, buildState) {
1919
const func = Object.keys(method)[0]
2020
const lower = method[func]
2121

22-
if (engine.isData(method, func)) return true
22+
if (engine.isData(method, func) || func === undefined) return true
2323
if (!engine.methods[func]) throw new Error(`Method '${func}' was not found in the Logic Engine.`)
2424

2525
if (engine.methods[func].lazy) {
@@ -44,7 +44,7 @@ function isSyncDeep (method, engine, buildState) {
4444
if (method && typeof method === 'object') {
4545
const func = Object.keys(method)[0]
4646
const lower = method[func]
47-
if (engine.isData(method, func)) return true
47+
if (engine.isData(method, func) || func === undefined) return true
4848
if (!engine.methods[func]) throw new Error(`Method '${func}' was not found in the Logic Engine.`)
4949
if (engine.methods[func].lazy) return typeof engine.methods[func][Sync] === 'function' ? engine.methods[func][Sync](lower, buildState) : engine.methods[func][Sync]
5050
return typeof engine.methods[func][Sync] === 'function' ? engine.methods[func][Sync](lower, buildState) : engine.methods[func][Sync] && isSyncDeep(lower, engine, buildState)

0 commit comments

Comments
 (0)