INNER CODE UNIT · JavaScript

list

JoasASantos/NeuroSploit · web/server.js:175

  const list = (v) => (Array.isArray(v) ? v : String(v || '').split(/[\n,;]+/)).map((x) => String(x).trim()).filter(Boolean);
  const block = (key, items) => {
    if (!items.length) return;
    lines.push(`${key}:`);
    for (const it of items) lines.push(`  - ${JSON.stringify(it)}`);
  };
  block('hard', list(scope.hard));
  block('exclude', list(scope.exclude));
  const soft = [];
  const obs = list(scope.observeOnly);
  if (obs.length) { soft.push('  observe_only:'); for (const o of obs) soft.push(`    - ${JSON.stringify(o)}`); }
  soft.push(`  allow_destructive_methods: ${scope.allowDestructive ? 'true' : 'false'}`);
  soft.push(`  allow_account_creation: ${scope.allowAccountCreation === false ? 'false' : 'true'}`);
  if (scope.maxAccounts !== undefined && scope.maxAccounts !== '') soft.push(`  max_accounts: ${Number(scope.maxAccounts) || 0}`);
  if (scope.rateLimit !== undefined && scope.rateLimit !== '') soft.push(`  max_requests_per_minute: ${Number(scope.rateLimit) || 0}`);
  const forb = list(scope.forbidden);
  if (forb.length) { soft.push('  forbidden_payloads:'); for (const fp of forb) soft.push(`    - ${JSON.stringify(fp)}`); }
  const notes = list(scope.notes);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…