nest-oidc-provider
Version:
oidc-provider module for Nest framework (node.js)
19 lines (18 loc) • 476 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validatePath = validatePath;
exports.getReqRes = getReqRes;
function validatePath(pathname) {
return ('/' +
(pathname || '')
.replace(/^\/+/, '')
.replace(/\/+$/, '')
.replace(/\/+/g, '/'));
}
function getReqRes(ctx) {
const http = ctx.switchToHttp();
return {
req: http.getRequest(),
res: http.getResponse(),
};
}