7 lines
288 B
TypeScript
7 lines
288 B
TypeScript
|
|
import { ALLOWED_COMMANDS } from "@tasks/shared/worker";
|
||
|
|
|
||
|
|
export function isAllowedCommand(command: string): boolean {
|
||
|
|
const normalized = command.trim().replace(/\s+/g, " ");
|
||
|
|
return ALLOWED_COMMANDS.some((allowed) => normalized === allowed || normalized.startsWith(`${allowed} `));
|
||
|
|
}
|