From 27b37e65d8ce96a94a1ac34db21dd59704b5b084 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Thu, 11 Jun 2026 00:26:33 +0000 Subject: [PATCH] [Refactor] Use uniq helper in session scopes Replace manual Set deduplication with the `uniq` helper from `@shopify/cli-kit/common/array` in `packages/cli-kit/src/private/node/session/scopes.ts`. This improves code consistency and readability by using existing utilities. --- 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 109f65f9726..5c47470e5df 100644 --- a/packages/cli-kit/src/private/node/session/scopes.ts +++ b/packages/cli-kit/src/private/node/session/scopes.ts @@ -1,4 +1,5 @@ import {allAPIs, API} from '../api.js' +import {uniq} from '../../../public/common/array.js' import {BugError} from '../../../public/node/error.js' /** @@ -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) } /**