| 37 | } |
| 38 | |
| 39 | export const arraysEqualShallow = <T>(a?: readonly T[], b?: readonly T[]) => { |
| 40 | if (a === b) return true; |
| 41 | if (a === undefined || b === undefined) return false; |
| 42 | if (a.length !== b.length) return false; |
| 43 | |
| 44 | const aSorted = a.toSorted(); |
| 45 | const bSorted = b.toSorted(); |
| 46 | |
| 47 | for (let i = 0; i < aSorted.length; i++) { |
| 48 | if (aSorted[i] !== bSorted[i]) { |
| 49 | return false; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | export const getShardPrefix = (orgId: number, repoId: number) => { |
| 57 | return `${orgId}_${repoId}`; |