-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
30 lines (29 loc) · 934 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function default_1() {
return function (req, res, next) {
if (req.header("X-PJAX")) {
res.render = function (view, options, callback) {
var done = callback;
var opts = options;
if (typeof options === "function") {
done = options;
opts = {};
}
if (!done) {
done = function (err, str) {
if (err)
return req.next(err);
res.send(str);
};
}
// eslint-disable-next-line
opts.layout = false;
req.app.render(view, opts, done);
};
}
next();
};
}
exports.default = default_1;
//# sourceMappingURL=index.js.map