p-limit.js 444 B

123456789101112131415161718
  1. // Mock implementation of p-limit for Jest tests
  2. // p-limit is a utility for limiting the number of concurrent promises
  3. const pLimit = (concurrency) => {
  4. // Return a function that just executes the passed function immediately
  5. // In tests, we don't need actual concurrency limiting
  6. return (fn) => {
  7. if (typeof fn === "function") {
  8. return fn()
  9. }
  10. return fn
  11. }
  12. }
  13. // Set default export
  14. pLimit.default = pLimit
  15. module.exports = pLimit