From 718e086ced799d76eb820336b82923b817b5a110 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Fri, 7 Oct 2022 14:40:13 -0400 Subject: [PATCH] fix: use older JS syntax, closes #40 --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dd69a67..4ec6243 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ const debug = require('debug')('cypress-if') -const isIfCommand = (cmd) => cmd?.attributes?.name === 'if' +const isIfCommand = (cmd) => + cmd && cmd.attributes && cmd.attributes.name === 'if' function skipRestOfTheChain(cmd, chainerId) { while (