santifer/career-ops · error · Error

--sort must be date or score

Error message

--sort must be date or score

What it means

Error "--sort must be date or score" thrown in santifer/career-ops.

Source

Thrown at company-funded.mjs:129

    const arg = argv[i];
    if (arg === '--dry-run') opts.dryRun = true;
    else if (arg === '--json') opts.json = true;
    else if (arg === '--self-test') opts.selfTest = true;
    else if (arg === '--help' || arg === '-h') opts.help = true;
    else if (arg === '--limit') opts.limit = Number(argv[++i] || '');
    else if (arg === '--months') opts.months = Number(argv[++i] || '');
    else if (arg === '--sort') opts.sort = String(argv[++i] || '').trim().toLowerCase();
    else if (arg === '--sources') opts.sources = parseSources(argv[++i] || '');
    else throw new Error(`unknown option: ${arg}`);
  }
  if (!Number.isInteger(opts.limit) || opts.limit <= 0 || opts.limit > 100) {
    throw new Error('--limit must be an integer from 1 to 100');
  }
  if (!Number.isInteger(opts.months) || opts.months <= 0 || opts.months > 120) {
    throw new Error('--months must be an integer from 1 to 120');
  }
  if (!['date', 'score'].includes(opts.sort)) {
    throw new Error('--sort must be date or score');
  }
  return opts;
}

function parseSources(value) {
  const out = String(value || '')
    .split(',')
    .map((s) => normalizeSourceName(s.trim()))
    .filter(Boolean);
  const unique = [...new Set(out)];
  const allowed = new Set(['techcrunch', 'prnewswire', 'guardian', 'hn']);
  for (const source of unique) {
    if (!allowed.has(source)) throw new Error(`unknown source in --sources: ${source}`);
  }
  return unique.length ? unique : [...DEFAULT_SOURCES];
}

function normalizeSourceName(value) {

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Use --sort date or --sort score.

Example fix

node company-funded.mjs --sort date

When it happens

Trigger: Thrown at company-funded.mjs:129 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/bb1e8e034bdef2ea. Report an issue: GitHub.