From b6e3ecb97b34d6cf623514b3ddbbf63e4f9b21ce Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 13 Jan 2022 14:56:27 +0530 Subject: fix: fixes null issue with property match --- src/eval/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/eval/index.ts b/src/eval/index.ts index 3912031..276f686 100644 --- a/src/eval/index.ts +++ b/src/eval/index.ts @@ -77,7 +77,7 @@ const checkExpr = ( PropertyMatch: ({ name, exprs }) => pipe( - Object.prototype.hasOwnProperty.call(item, name) + Object.prototype.hasOwnProperty.call(item ?? {}, name) ? checkExpr(Expr.Group({ exprs }), item[name], list, index) : [], res => (res.length > 0 ? [group(item, index)] : []), // FIXME: doesn't allow nested matching -- cgit v1.3.1