Comparing version 0.0.5 to 0.0.6
@@ -8,2 +8,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: Buffer | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -13,2 +14,3 @@ export declare const jsonBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: any): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -18,2 +20,3 @@ export declare const rawBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: Buffer | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -23,2 +26,3 @@ export declare const textBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: string | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -30,2 +34,3 @@ export declare const urlencodedBodyContext: { | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: import("qs").ParsedQs | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -35,2 +40,3 @@ export declare const queryContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: import("qs").ParsedQs): <V_1>(next: () => V_1) => Promise<any>; | ||
}; |
@@ -7,2 +7,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
chain(...params: Params): <V>(next: () => V) => Promise<any>; | ||
with(value: T): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -12,2 +13,3 @@ export declare const requestContext: { | ||
chain(params_0: IncomingMessage): <V>(next: () => V) => Promise<any>; | ||
with(value: IncomingMessage): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -17,2 +19,3 @@ export declare const responseContext: { | ||
chain(params_0: ServerResponse<IncomingMessage>): <V>(next: () => V) => Promise<any>; | ||
with(value: ServerResponse<IncomingMessage>): <V_1>(next: () => V_1) => Promise<any>; | ||
}; |
@@ -18,2 +18,7 @@ "use strict"; | ||
}, | ||
with(value) { | ||
return async (next) => { | ||
return end(await asyncLocalStorage.run(value, next), value); | ||
}; | ||
}, | ||
}; | ||
@@ -28,2 +33,2 @@ }; | ||
exports.responseContext = (0, exports.makeContext)(jmisc_1.identity); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHVEQUFrRDtBQUdsRCxpQ0FBOEI7QUFFdkIsTUFBTSxXQUFXLEdBQUcsQ0FDMUIsS0FBMkMsRUFDM0MsTUFBc0MsZ0JBQVEsRUFDN0MsRUFBRTtJQUNILE1BQU0saUJBQWlCLEdBQUcsSUFBSSxvQ0FBaUIsRUFBSyxDQUFBO0lBQ3BELE9BQU87UUFDTixJQUFJLEtBQUs7WUFDUixPQUFPLGlCQUFpQixDQUFDLFFBQVEsRUFBRyxDQUFBO1FBQ3JDLENBQUM7UUFDRCxLQUFLLENBQUMsR0FBRyxNQUFjO1lBQ3RCLE9BQU8sS0FBSyxFQUFLLElBQWEsRUFBRSxFQUFFO2dCQUNqQyxNQUFNLEtBQUssR0FBRyxNQUFNLEtBQUssQ0FBQyxHQUFHLE1BQU0sQ0FBQyxDQUFBO2dCQUNwQyxPQUFPLEdBQUcsQ0FBQyxNQUFNLGlCQUFpQixDQUFDLEdBQUcsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLEVBQUUsS0FBSyxDQUFDLENBQUE7WUFDNUQsQ0FBQyxDQUFBO1FBQ0YsQ0FBQztLQUNELENBQUE7QUFDRixDQUFDLENBQUE7QUFoQlksUUFBQSxXQUFXLGVBZ0J2QjtBQUVELGVBQWU7QUFDZixnREFBZ0Q7QUFDaEQsMkZBQTJGO0FBQzNGLGdGQUFnRjtBQUNuRSxRQUFBLGNBQWMsR0FBRyxJQUFBL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xLQUFLLENBQUMsQ0FBQTtZQUM1RCxDQUFDLENBQUE7UUFDRixDQUFDO0tBQ0QsQ0FBQTtBQUNGLENBQUMsQ0FBQTtBQXJCWSxRQUFBLFdBQVcsZUFxQnZCO0FBRUQsZUFBZTtBQUNmLGdEQUFnRDtBQUNoRCwyRkFBMkY7QUFDM0YsZ0ZBQWdGO0FBQ25FLFFBQUEsY0FBYyxHQUFHLElBQUEsbUJBQVcsRUFBcUMsZ0JBQVEsQ0FBQyxDQUFBO0FBQzFFLFFBQUEsZUFBZSxHQUFHLElBQUEsbUJBQVcsRUFBbUMsZ0JBQVEsQ0FBQyxDQUFBIn0= |
@@ -35,2 +35,28 @@ /// <reference types="node" resolution-mode="require"/> | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: { | ||
charset?: BufferEncoding | undefined; | ||
jsonBeautify?: boolean | undefined; | ||
disableEtag?: boolean | undefined; | ||
} & ({ | ||
type: 'text'; | ||
data: string; | ||
} | { | ||
type: 'html'; | ||
data: string; | ||
} | { | ||
type: 'buffer'; | ||
data: Buffer; | ||
} | { | ||
type: 'json'; | ||
data: any; | ||
} | { | ||
type: 'redirect'; | ||
data: string; | ||
} | { | ||
type: 'nodeStream'; | ||
data: Readable; | ||
} | { | ||
type: 'webStream'; | ||
data: ReadableStream; | ||
})): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -37,0 +63,0 @@ export declare function setText(text: string, { status }?: { |
@@ -8,2 +8,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: Buffer | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -13,2 +14,3 @@ export declare const jsonBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: any): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -18,2 +20,3 @@ export declare const rawBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: Buffer | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -23,2 +26,3 @@ export declare const textBodyContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: string | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -30,2 +34,3 @@ export declare const urlencodedBodyContext: { | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: import("qs").ParsedQs | undefined): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -35,2 +40,3 @@ export declare const queryContext: { | ||
chain(): <V>(next: () => V) => Promise<any>; | ||
with(value: import("qs").ParsedQs): <V_1>(next: () => V_1) => Promise<any>; | ||
}; |
@@ -7,2 +7,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
chain(...params: Params): <V>(next: () => V) => Promise<any>; | ||
with(value: T): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -12,2 +13,3 @@ export declare const requestContext: { | ||
chain(params_0: IncomingMessage): <V>(next: () => V) => Promise<any>; | ||
with(value: IncomingMessage): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -17,2 +19,3 @@ export declare const responseContext: { | ||
chain(params_0: ServerResponse<IncomingMessage>): <V>(next: () => V) => Promise<any>; | ||
with(value: ServerResponse<IncomingMessage>): <V_1>(next: () => V_1) => Promise<any>; | ||
}; |
@@ -15,2 +15,7 @@ import { AsyncLocalStorage } from 'node:async_hooks'; | ||
}, | ||
with(value) { | ||
return async (next) => { | ||
return end(await asyncLocalStorage.run(value, next), value); | ||
}; | ||
}, | ||
}; | ||
@@ -24,2 +29,2 @@ }; | ||
export const responseContext = makeContext(identity); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8s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tBQUNoRixNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsV0FBVyxDQUFxQyxRQUFRLENBQUMsQ0FBQTtBQUN2RixNQUFNLENBQUMsTUFBTSxlQUFlLEdBQUcsV0FBVyxDQUFtQyxRQUFRLENBQUMsQ0FBQSJ9 |
@@ -35,2 +35,28 @@ /// <reference types="node" resolution-mode="require"/> | ||
} | undefined): <V>(next: () => V) => Promise<any>; | ||
with(value: { | ||
charset?: BufferEncoding | undefined; | ||
jsonBeautify?: boolean | undefined; | ||
disableEtag?: boolean | undefined; | ||
} & ({ | ||
type: 'text'; | ||
data: string; | ||
} | { | ||
type: 'html'; | ||
data: string; | ||
} | { | ||
type: 'buffer'; | ||
data: Buffer; | ||
} | { | ||
type: 'json'; | ||
data: any; | ||
} | { | ||
type: 'redirect'; | ||
data: string; | ||
} | { | ||
type: 'nodeStream'; | ||
data: Readable; | ||
} | { | ||
type: 'webStream'; | ||
data: ReadableStream; | ||
})): <V_1>(next: () => V_1) => Promise<any>; | ||
}; | ||
@@ -37,0 +63,0 @@ export declare function setText(text: string, { status }?: { |
{ | ||
"name": "dx-server", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "./cjs/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/tranvansang/dx-server", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155625
2055