MCPcopy Create free account
hub / github.com/pingdotgg/t3code / projectScriptIdFromCommand

Function projectScriptIdFromCommand

apps/web/src/projectScripts.ts:28–35  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

26 SCRIPT_RUN_COMMAND_PATTERN.make(`script.${scriptId}.run`);
27
28export 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
37export function nextProjectScriptId(name: string, existingIds: Iterable<string>): string {
38 const taken = new Set(Array.from(existingIds));

Callers 2

handlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected