{"version":3,"file":"delay.min.mjs","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"],"names":["delay","time","next","url","opts","Promise","res","setTimeout"],"mappings":"AAkBa,MAAAA,EAAyBC,GAAQC,GAAQ,CAACC,EAAKC,IACnD,IAAIC,SAAQC,GAAOC,YAAW,IAAMD,EAAIJ,EAAKC,EAAKC,KAAQH"}