INNER CODE UNIT · TypeScript

parseCruxCommand

dyrector-io/dyrectorio · web/crux/src/main.ts:32

const parseCruxCommand = (args: string[]): CruxCommand | null => {
  if (args.length < 3) {
    return null
  }

  const command: string = args[2]
  if (!CRUX_COMMANDS.some(it => it === command)) {
    return null
  }

  return command as CruxCommand
}

const createLogger = (): Logger | LogLevel[] => {
  if (process.env.NODE_ENV === 'production') {
    return new Logger()
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…