node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

29
server/node_modules/koa-helmet/lib/koa-helmet.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
const helmet = require('helmet');
const { promisify } = require('util');
const koaHelmet = function () {
const helmetPromise = promisify(helmet.apply(null, arguments));
const middleware = (ctx, next) => {
return helmetPromise(ctx.req, ctx.res).then(next);
};
middleware._name = 'helmet';
return middleware;
};
Object.keys(helmet).forEach(function (helmetMethod) {
koaHelmet[helmetMethod] = function () {
const methodPromise = promisify(helmet[helmetMethod].apply(null, arguments));
return (ctx, next) => {
return methodPromise(ctx.req, ctx.res).then(next);
};
};
Object.keys(helmet[helmetMethod]).forEach((methodExports) => {
koaHelmet[helmetMethod][methodExports] = helmet[helmetMethod][methodExports];
});
});
module.exports = koaHelmet;