Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 1x 1x 2x 2x 2x 1x 1x 1x 3x 2x 1x | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cls_hooked_1 = require("cls-hooked");
var ctx = cls_hooked_1.createNamespace("express-ctx");
function middleware(req, res, next) {
ctx.bindEmitter(req);
ctx.bindEmitter(res);
ctx.run(function () { return next(); });
}
exports.middleware = middleware;
function setValue(key, value) {
ctx.set(key, value);
}
exports.setValue = setValue;
function getValue(key) {
if (ctx && ctx.active) {
return ctx.get(key);
}
}
exports.getValue = getValue;
|