From 499bbb9da05427ff3812c08aa6d466a7b4333cfa Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Fri, 22 May 2026 00:39:57 +0000 Subject: [PATCH 1/3] [Refactor] Use .find() in error-handler Replaces .filter(...)[0] with .find(...) in cleanStackFrameFilePath for better readability and slightly better performance via short-circuiting. --- packages/cli-kit/src/public/node/error-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli-kit/src/public/node/error-handler.ts b/packages/cli-kit/src/public/node/error-handler.ts index 5735d2b823a..d639c9d3d33 100644 --- a/packages/cli-kit/src/public/node/error-handler.ts +++ b/packages/cli-kit/src/public/node/error-handler.ts @@ -192,7 +192,7 @@ export function cleanStackFrameFilePath({ ? currentFilePath : path.joinPath(projectRoot, currentFilePath) - const matchingPluginPath = pluginLocations.filter(({pluginPath}) => fullLocation.startsWith(pluginPath))[0] + const matchingPluginPath = pluginLocations.find(({pluginPath}) => fullLocation.startsWith(pluginPath)) if (matchingPluginPath !== undefined) { // the plugin name (e.g. @shopify/cli-kit), plus the relative path of the error line from within the plugin's code (e.g. dist/something.js ) From 756ead8b1cd0ed0ee1f7ac7c74fa5e16fb469c67 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Mon, 25 May 2026 10:10:00 +0000 Subject: [PATCH 2/3] [Refactor] Use find instead of filter[0] in error-handler Replacing .filter(...)[0] with .find(...) is more idiomatic and efficient as it avoids creating an intermediate array and can short-circuit once a match is found. From b68e6a7998682f0351f33799c56aee4100432a0a Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Mon, 25 May 2026 11:20:51 +0000 Subject: [PATCH 3/3] [Refactor] Use find instead of filter[0] in error-handler Replacing .filter(...)[0] with .find(...) is more idiomatic and efficient as it avoids creating an intermediate array and can short-circuit once a match is found.