Skip to content

Commit 1c6cb79

Browse files
committed
fix: support Token.Scope.toArray()
1 parent 9c07a97 commit 1c6cb79

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/oauth2-cli/src/Token/Scope.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ export function toString(scope: ish, separator = ' '): string {
66
}
77
return scope.join(separator);
88
}
9+
10+
export function toArray(scope: ish, separator = ' '): string[] {
11+
if (Array.isArray(scope)) {
12+
return scope;
13+
}
14+
return scope.split(separator);
15+
}

0 commit comments

Comments
 (0)