Skip to content

Commit 01610c8

Browse files
committed
fix: trim the github usernames from google workspace
1 parent 8a9debe commit 01610c8

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/google.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function formatUserList(users: any[]): Set<string> {
5151
return new Set(
5252
users
5353
.map((user) =>
54-
user.customSchemas?.Accounts?.github?.map((account: { value: string }) => account.value?.toLowerCase()),
54+
user.customSchemas?.Accounts?.github?.map((account: { value: string }) => account.value?.toLowerCase().trim()),
5555
)
5656
.flat()
5757
.filter(Boolean),

tests/__snapshots__/google.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Set {
1212
exports[`google integration formatUserList bad 1`] = `
1313
Set {
1414
"chrisns",
15+
"userspace",
1516
}
1617
`;
1718

tests/google.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe('google integration', () => {
6666
{ customSchemas: { Accounts: { github: [] } } },
6767
{ customSchemas: { Accounts: { github: [{}] } } },
6868
{ customSchemas: { Accounts: { github: [{ value: 'chrisns' }] } } },
69+
{ customSchemas: { Accounts: { github: [{ value: 'userspace ' }] } } },
6970
]),
7071
).toMatchSnapshot())
7172
})

0 commit comments

Comments
 (0)