From 7463f4d17608b0dfab9e712dbac721e623d62e86 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 30 Dec 2024 13:15:05 +0000 Subject: [PATCH] perf(index): use optional chaining (#47) Signed-off-by: Frazer Smith --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 37f7f5b..1437513 100644 --- a/index.js +++ b/index.js @@ -33,7 +33,7 @@ function safeRegex (re, opts) { if (!ok) return false } } - const stack = node.stack || (node.value && node.value.stack) + const stack = node.stack || node.value?.stack if (!stack) return true for (i = 0; i < stack.length; i++) {