(command: string)
| 26 | SCRIPT_RUN_COMMAND_PATTERN.make(`script.${scriptId}.run`); |
| 27 | |
| 28 | export function projectScriptIdFromCommand(command: string): string | null { |
| 29 | const trimmed = command.trim(); |
| 30 | if (!isScriptRunCommand(trimmed)) { |
| 31 | return null; |
| 32 | } |
| 33 | const [prefix, , suffix] = SCRIPT_RUN_COMMAND_PATTERN.parts; |
| 34 | return trimmed.slice(prefix.literal.length, -suffix.literal.length); |
| 35 | } |
| 36 | |
| 37 | export function nextProjectScriptId(name: string, existingIds: Iterable<string>): string { |
| 38 | const taken = new Set(Array.from(existingIds)); |
no outgoing calls
no test coverage detected