(a: string, b: string)
| 1677 | const suffixes = [`${base}.lua`, `${base}.luau`, `${base}/init.lua`, `${base}/init.luau`]; |
| 1678 | const byBasename = luaBasenameIndex(context); |
| 1679 | const shared = (a: string, b: string): number => { |
| 1680 | let i = 0; |
| 1681 | while (i < a.length && i < b.length && a[i] === b[i]) i++; |
| 1682 | return i; |
| 1683 | }; |
| 1684 | for (const suffix of suffixes) { |
| 1685 | // Only files sharing the suffix's basename can match — the bucket is in |
| 1686 | // getAllFiles() order, so this filter yields exactly what the full-list |