(a: string, b: string)
| 1692 | const suffixes = [`${base}.lua`, `${base}.luau`, `${base}/init.lua`, `${base}/init.luau`]; |
| 1693 | const byBasename = luaBasenameIndex(context); |
| 1694 | const shared = (a: string, b: string): number => { |
| 1695 | let i = 0; |
| 1696 | while (i < a.length && i < b.length && a[i] === b[i]) i++; |
| 1697 | return i; |
| 1698 | }; |
| 1699 | for (const suffix of suffixes) { |
| 1700 | // Only files sharing the suffix's basename can match — the bucket is in |
| 1701 | // getAllFiles() order, so this filter yields exactly what the full-list |