From cf5fdd41a6aa50a8774cec4e9342fc12b67c8760 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Sun, 7 Jun 2026 00:42:02 +0000 Subject: [PATCH] [Refactor] Use uniq helper in session scopes --- 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) } /**