{"record":{"id":"7b568e2298c2c6b4","repo":"oven-sh/bun","slug":"expected-concurrency-to-be-a-number-from-1-and-u","errorCode":null,"errorMessage":"Expected `concurrency` to be a number from 1 and up","messagePattern":"Expected `concurrency` to be a number from 1 and up","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"scripts/p-limit.mjs","lineNumber":107,"sourceCode":"          }\n        });\n      },\n    },\n  });\n\n  return generator;\n}\n\nexport function limitFunction(function_, option) {\n  const { concurrency } = option;\n  const limit = pLimit(concurrency);\n\n  return (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n  if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n    throw new TypeError(\"Expected `concurrency` to be a number from 1 and up\");\n  }\n}\n","sourceCodeStart":89,"sourceCodeEnd":110,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/p-limit.mjs#L89-L110","documentation":"Validation in the vendored p-limit copy: limitFunction/pLimit require concurrency to be a positive integer (or Number.POSITIVE_INFINITY). Thrown as a TypeError when the caller passes 0, a negative number, or a non-integer value.","triggerScenarios":"Thrown at scripts/p-limit.mjs:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive integer (or Infinity) as concurrency","Coerce/validate user input before calling pLimit"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}