Buckets:
| ; | |
| var __defProp = Object.defineProperty; | |
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| var __getOwnPropNames = Object.getOwnPropertyNames; | |
| var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| var __export = (target, all) => { | |
| for (var name in all) | |
| __defProp(target, name, { get: all[name], enumerable: true }); | |
| }; | |
| var __copyProps = (to, from, except, desc) => { | |
| if (from && typeof from === "object" || typeof from === "function") { | |
| for (let key of __getOwnPropNames(from)) | |
| if (!__hasOwnProp.call(to, key) && key !== except) | |
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | |
| } | |
| return to; | |
| }; | |
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| var compose_exports = {}; | |
| __export(compose_exports, { | |
| compose: () => compose | |
| }); | |
| module.exports = __toCommonJS(compose_exports); | |
| const compose = (middleware, onError, onNotFound) => { | |
| return (context, next) => { | |
| let index = -1; | |
| return dispatch(0); | |
| async function dispatch(i) { | |
| if (i <= index) { | |
| throw new Error("next() called multiple times"); | |
| } | |
| index = i; | |
| let res; | |
| let isError = false; | |
| let handler; | |
| if (middleware[i]) { | |
| handler = middleware[i][0][0]; | |
| context.req.routeIndex = i; | |
| } else { | |
| handler = i === middleware.length && next || void 0; | |
| } | |
| if (handler) { | |
| try { | |
| res = await handler(context, () => dispatch(i + 1)); | |
| } catch (err) { | |
| if (err instanceof Error && onError) { | |
| context.error = err; | |
| res = await onError(err, context); | |
| isError = true; | |
| } else { | |
| throw err; | |
| } | |
| } | |
| } else { | |
| if (context.finalized === false && onNotFound) { | |
| res = await onNotFound(context); | |
| } | |
| } | |
| if (res && (context.finalized === false || isError)) { | |
| context.res = res; | |
| } | |
| return context; | |
| } | |
| }; | |
| }; | |
| // Annotate the CommonJS export names for ESM import in node: | |
| 0 && (module.exports = { | |
| compose | |
| }); | |
Xet Storage Details
- Size:
- 2.15 kB
- Xet hash:
- bd9e3e30e5f05c2de52f61fafad7569c3e8fad505bb06fa013203831c19a6f91
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.