You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
925 B
28 lines
925 B
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isMultipart = void 0;
|
|
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
|
|
const kMultipart = Symbol('multipart');
|
|
function setMultipart(req, _payload, done) {
|
|
;
|
|
req[kMultipart] = true;
|
|
done(null);
|
|
}
|
|
function isMultipart() {
|
|
return this.raw[kMultipart] || false;
|
|
}
|
|
exports.isMultipart = isMultipart;
|
|
function fastifyMulter(fastify, _options, next) {
|
|
fastify.addContentTypeParser('multipart', setMultipart);
|
|
fastify.decorateRequest('isMultipart', isMultipart);
|
|
next();
|
|
}
|
|
const multer = (0, fastify_plugin_1.default)(fastifyMulter, {
|
|
fastify: '>= 3.0.0',
|
|
name: 'fastify-multer',
|
|
});
|
|
exports.default = multer;
|
|
//# sourceMappingURL=content-parser.js.map
|