Pass scopes through to authentication providers

This commit is contained in:
Rachel Macfarlane
2021-02-11 12:28:17 -08:00
parent a7758e4328
commit 650906c369
14 changed files with 82 additions and 39 deletions

View File

@@ -71,3 +71,25 @@ export async function promiseFromEvent<T, U>(
}
);
}
export function arrayEquals<T>(one: ReadonlyArray<T> | undefined, other: ReadonlyArray<T> | undefined, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {
if (one === other) {
return true;
}
if (!one || !other) {
return false;
}
if (one.length !== other.length) {
return false;
}
for (let i = 0, len = one.length; i < len; i++) {
if (!itemEquals(one[i], other[i])) {
return false;
}
}
return true;
}