{"version":3,"file":"delay.min.cjs","names":[],"sources":["../../../src/middlewares/delay.ts"],"sourcesContent":["import type { ConfiguredMiddleware } from \"../types.js\"\n\n/* Types */\n\n/**\n * ##  Delay middleware\n *\n * ### Delays the request by a specific amount of time.\n *\n * **Options**\n *\n * - *time* `milliseconds`\n *\n * > The request will be delayed by that amount of time.\n */\nexport type DelayMiddleware = (time: number) => ConfiguredMiddleware\n\n\nexport const delay: DelayMiddleware = time => next => (url, opts) => {\n  return new Promise(res => setTimeout(() => res(next(url, opts)), time))\n}\n"],"mappings":"mEAkBA,MAAa,EAAyB,GAAQ,IAAS,EAAK,IACnD,IAAI,QAAQ,GAAO,eAAiB,EAAI,EAAK,EAAK,EAAK,CAAC,CAAE,EAAK,CAAC"}