(a: string, b: string)
| 153 | /^(setup|sessionstart|cwdchanged|filechanged)-hook-(\d+)\.sh$/ |
| 154 | |
| 155 | function sortHookEnvFiles(a: string, b: string): number { |
| 156 | const aMatch = a.match(HOOK_ENV_REGEX) |
| 157 | const bMatch = b.match(HOOK_ENV_REGEX) |
| 158 | const aType = aMatch?.[1] || '' |
| 159 | const bType = bMatch?.[1] || '' |
| 160 | if (aType !== bType) { |
| 161 | return (HOOK_ENV_PRIORITY[aType] ?? 99) - (HOOK_ENV_PRIORITY[bType] ?? 99) |
| 162 | } |
| 163 | const aIndex = parseInt(aMatch?.[2] || '0', 10) |
| 164 | const bIndex = parseInt(bMatch?.[2] || '0', 10) |
| 165 | return aIndex - bIndex |
| 166 | } |
nothing calls this directly
no outgoing calls
no test coverage detected