function createFetchApi(options) {
  let result = options.baseImplementation || global.fetch;
  const middleware = [options.middleware ?? []].flat().reverse();
  for (const m of middleware) {
    result = m.apply(result);
  }
  return {
    fetch: result
  };
}

export { createFetchApi };
//# sourceMappingURL=createFetchApi.esm.js.map
