(exports2, module2)
| 24591 | // node_modules/form-data/lib/form_data.js |
| 24592 | var require_form_data = __commonJS({ |
| 24593 | "node_modules/form-data/lib/form_data.js"(exports2, module2) { |
| 24594 | var CombinedStream = require_combined_stream(); |
| 24595 | var util4 = require("util"); |
| 24596 | var path5 = require("path"); |
| 24597 | var http4 = require("http"); |
| 24598 | var https3 = require("https"); |
| 24599 | var parseUrl = require("url").parse; |
| 24600 | var fs7 = require("fs"); |
| 24601 | var Stream3 = require("stream").Stream; |
| 24602 | var mime = require_mime_types(); |
| 24603 | var asynckit = require_asynckit(); |
| 24604 | var populate = require_populate(); |
| 24605 | module2.exports = FormData6; |
| 24606 | util4.inherits(FormData6, CombinedStream); |
| 24607 | function FormData6(options) { |
| 24608 | if (!(this instanceof FormData6)) { |
| 24609 | return new FormData6(options); |
| 24610 | } |
| 24611 | this._overheadLength = 0; |
| 24612 | this._valueLength = 0; |
| 24613 | this._valuesToMeasure = []; |
| 24614 | CombinedStream.call(this); |
| 24615 | options = options || {}; |
| 24616 | for (var option in options) { |
| 24617 | this[option] = options[option]; |
| 24618 | } |
| 24619 | } |
| 24620 | FormData6.LINE_BREAK = "\r\n"; |
| 24621 | FormData6.DEFAULT_CONTENT_TYPE = "application/octet-stream"; |
| 24622 | FormData6.prototype.append = function(field, value, options) { |
| 24623 | options = options || {}; |
| 24624 | if (typeof options == "string") { |
| 24625 | options = { filename: options }; |
| 24626 | } |
| 24627 | var append2 = CombinedStream.prototype.append.bind(this); |
| 24628 | if (typeof value == "number") { |
| 24629 | value = "" + value; |
| 24630 | } |
| 24631 | if (util4.isArray(value)) { |
| 24632 | this._error(new Error("Arrays are not supported.")); |
| 24633 | return; |
| 24634 | } |
| 24635 | var header = this._multiPartHeader(field, value, options); |
| 24636 | var footer = this._multiPartFooter(); |
| 24637 | append2(header); |
| 24638 | append2(value); |
| 24639 | append2(footer); |
| 24640 | this._trackLength(header, value, options); |
| 24641 | }; |
| 24642 | FormData6.prototype._trackLength = function(header, value, options) { |
| 24643 | var valueLength = 0; |
| 24644 | if (options.knownLength != null) { |
| 24645 | valueLength += +options.knownLength; |
| 24646 | } else if (Buffer.isBuffer(value)) { |
| 24647 | valueLength = value.length; |
| 24648 | } else if (typeof value === "string") { |
| 24649 | valueLength = Buffer.byteLength(value); |
| 24650 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…