@@ -5,7 +5,6 @@ import { UndefinedFactError } from './errors'
55import debug from './debug'
66
77import { JSONPath } from 'jsonpath-plus'
8- import isObjectLike from 'lodash/isObjectLike'
98
109function defaultPathResolver ( value , path ) {
1110 return JSONPath ( { path, json : value , wrap : false } )
@@ -161,7 +160,7 @@ export default class Almanac {
161160 debug ( `condition::evaluate extracting object property ${ path } ` )
162161 return factValuePromise
163162 . then ( factValue => {
164- if ( isObjectLike ( factValue ) ) {
163+ if ( factValue != null && typeof factValue === 'object' ) {
165164 const pathValue = this . pathResolver ( factValue , path )
166165 debug ( `condition::evaluate extracting object property ${ path } , received: ${ JSON . stringify ( pathValue ) } ` )
167166 return pathValue
@@ -179,7 +178,7 @@ export default class Almanac {
179178 * Interprets value as either a primitive, or if a fact, retrieves the fact value
180179 */
181180 getValue ( value ) {
182- if ( isObjectLike ( value ) && Object . prototype . hasOwnProperty . call ( value , 'fact' ) ) { // value = { fact: 'xyz' }
181+ if ( value != null && typeof value === 'object' && Object . prototype . hasOwnProperty . call ( value , 'fact' ) ) { // value = { fact: 'xyz' }
183182 return this . factValue ( value . fact , value . params , value . path )
184183 }
185184 return Promise . resolve ( value )
0 commit comments