(path: string)
| 445 | * or -1 when it doesn't look like an identity at all. Shared by the sample |
| 446 | * picker below and the candidate ranking in the connect flow. */ |
| 447 | export const identityPathTier = (path: string): number => { |
| 448 | const segments = path.split("."); |
| 449 | const named = segments.filter((segment) => !/^\d+$/.test(segment)); |
| 450 | const leaf = (named[named.length - 1] ?? "").toLowerCase(); |
| 451 | return IDENTITY_KEY_TIERS.findIndex((keys) => keys.includes(leaf)); |
| 452 | }; |
| 453 | |
| 454 | /** Order sample rows identity-first: rows whose leaf key names the account |
| 455 | * (email > login > name > id) come before the rest, which keep response |
no outgoing calls
no test coverage detected