From c72a063f94e5bf9560d9fd8f37d5d11b53bcb06e Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Sat, 6 Jun 2026 00:35:46 +0000 Subject: [PATCH] [Refactor] Use uniq helper in scopes.ts Replace manual Array.from(new Set(scopes)) deduplication with the uniq helper from @shopify/cli-kit/common/array in scopes.ts. --- packages/cli-kit/src/private/node/session/scopes.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli-kit/src/private/node/session/scopes.ts b/packages/cli-kit/src/private/node/session/scopes.ts index 109f65f972..19d0f35a5c 100644 --- a/packages/cli-kit/src/private/node/session/scopes.ts +++ b/packages/cli-kit/src/private/node/session/scopes.ts @@ -1,5 +1,6 @@ import {allAPIs, API} from '../api.js' import {BugError} from '../../../public/node/error.js' +import {uniq} from '../../../public/common/array.js' /** * Generate a flat array with all the default scopes for all the APIs plus @@ -10,7 +11,7 @@ import {BugError} from '../../../public/node/error.js' export function allDefaultScopes(extraScopes: string[] = []): string[] { let scopes = allAPIs.map((api) => defaultApiScopes(api)).flat() scopes = ['openid', ...scopes, ...extraScopes].map(scopeTransform) - return Array.from(new Set(scopes)) + return uniq(scopes) } /** @@ -22,7 +23,7 @@ export function allDefaultScopes(extraScopes: string[] = []): string[] { */ export function apiScopes(api: API, extraScopes: string[] = []): string[] { const scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform) - return Array.from(new Set(scopes)) + return uniq(scopes) } /**