From 4f016e385c3a70a7da5d2b03b60ef5e10c25c8c4 Mon Sep 17 00:00:00 2001 From: henlamk <62616875+henlamk@users.noreply.github.com> Date: Wed, 11 May 2022 14:40:06 +0200 Subject: [PATCH] Update identical-keys.js --- src/identical-keys.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/identical-keys.js b/src/identical-keys.js index f941b99..b22280b 100644 --- a/src/identical-keys.js +++ b/src/identical-keys.js @@ -8,9 +8,8 @@ const noDifferenceRegex = /Compared\s+values\s+have\s+no\s+visual\s+difference/i // pick the first match. const getKeyStructureFromMap = (filePathMap, sourceFilePath) => { // do a suffix match - const match = Object.keys(filePathMap) - .filter(filePath => sourceFilePath.endsWith(filePath)) - .pop(); + const match = sourceFilePath.substr(sourceFilePath.lastIndexOf('/') + 1); + if (match) { try { const filepath = filePathMap[match];