formdata-node
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -18,7 +18,7 @@ "use strict"; | ||
var _stream = require("stream"); | ||
var _stream = _interopRequireDefault(require("stream")); | ||
var _util = require("util"); | ||
var _util = _interopRequireDefault(require("util")); | ||
var _path = require("path"); | ||
var _path = _interopRequireDefault(require("path")); | ||
@@ -56,2 +56,11 @@ var _mimeTypes = _interopRequireDefault(require("mime-types")); | ||
} = Object; | ||
const { | ||
Readable | ||
} = _stream.default; | ||
const { | ||
inspect | ||
} = _util.default; | ||
const { | ||
basename | ||
} = _path.default; | ||
/** | ||
@@ -69,3 +78,3 @@ * @typedef {Object} FieldOptions | ||
let FormData = (_class = (_temp = (_Symbol$toStringTag = Symbol.toStringTag, _Symbol$iterator = Symbol.iterator, _Symbol$asyncIterator = Symbol.asyncIterator, _inspect$custom = _util.inspect.custom, class FormData { | ||
let FormData = (_class = (_temp = (_Symbol$toStringTag = Symbol.toStringTag, _Symbol$iterator = Symbol.iterator, _Symbol$asyncIterator = Symbol.asyncIterator, _inspect$custom = inspect.custom, class FormData { | ||
/** | ||
@@ -184,3 +193,3 @@ * Generates a new boundary string once FormData instance constructed | ||
}); | ||
(0, _defineProperty2.default)(this, "inspect", this[_util.inspect.custom]); | ||
(0, _defineProperty2.default)(this, "inspect", this[inspect.custom]); | ||
@@ -343,5 +352,5 @@ if (isArray(fields)) { | ||
if (isBuffer(value) && filename) { | ||
filename = (0, _path.basename)(filename); | ||
filename = basename(filename); | ||
} else if ((0, _isBlob.default)(value)) { | ||
filename = (0, _path.basename)(value.name || filename || value.constructor.name === "Blob" ? "blob" : String(value.name)); | ||
filename = basename(value.name || filename || value.constructor.name === "Blob" ? "blob" : String(value.name)); | ||
} else if ((0, _isStream.default)(value) && (value.path || filename)) { | ||
@@ -351,3 +360,3 @@ // Readable stream which created from fs.createReadStream | ||
// from the stream itself. | ||
filename = (0, _path.basename)(value.path || filename); | ||
filename = basename(value.path || filename); | ||
} // Normalize field content | ||
@@ -694,3 +703,3 @@ | ||
initializer: function () { | ||
return new _stream.Readable({ | ||
return new Readable({ | ||
read: () => this.__read() | ||
@@ -697,0 +706,0 @@ }); |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _stream = require("stream"); | ||
var _stream = _interopRequireDefault(require("stream")); | ||
@@ -22,2 +22,5 @@ var _mimeTypes = _interopRequireDefault(require("mime-types")); | ||
} = Buffer; | ||
const { | ||
Readable | ||
} = _stream.default; | ||
/** | ||
@@ -44,3 +47,3 @@ * @api private | ||
if (isBuffer(content)) { | ||
const readable = new _stream.Readable({ | ||
const readable = new Readable({ | ||
read() {} | ||
@@ -47,0 +50,0 @@ |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _fs = require("fs"); | ||
var _fs = _interopRequireDefault(require("fs")); | ||
@@ -24,3 +24,3 @@ var _isReadStream = _interopRequireDefault(require("./isReadStream")); | ||
stat | ||
} = _fs.promises; | ||
} = _fs.default.promises; | ||
/** | ||
@@ -27,0 +27,0 @@ * Get lenght of given value (in bytes) |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,3 +10,3 @@ value: true | ||
var _stream = require("stream"); | ||
var _stream = _interopRequireDefault(require("stream")); | ||
@@ -14,3 +16,3 @@ /** | ||
*/ | ||
const isReadable = val => val instanceof _stream.Readable; | ||
const isReadable = val => val instanceof _stream.default.Readable; | ||
@@ -17,0 +19,0 @@ var _default = isReadable; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,3 +10,3 @@ value: true | ||
var _fs = require("fs"); | ||
var _fs = _interopRequireDefault(require("fs")); | ||
@@ -14,3 +16,3 @@ /** | ||
*/ | ||
const isReadStream = value => value instanceof _fs.ReadStream; | ||
const isReadStream = value => value instanceof _fs.default.ReadStream; | ||
@@ -17,0 +19,0 @@ var _default = isReadStream; |
{ | ||
"name": "formdata-node", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "FormData implementation for Node.js. Built over Readable stream and async generators.", | ||
@@ -5,0 +5,0 @@ "repository": "octet-stream/form-data", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71130
2004