Innovenergy_trunk/frontend/node_modules/testcafe-hammerhead/lib/upload/index.js

18 lines
617 B
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.inject = void 0;
const form_data_1 = __importDefault(require("./form-data"));
function inject(contentTypeHeader, body) {
const formData = new form_data_1.default();
formData.parseContentTypeHeader(contentTypeHeader);
if (!formData.boundary)
return null;
formData.parseBody(body);
formData.expandUploads();
return formData.toBuffer();
}
exports.inject = inject;