Socket
Socket
Sign inDemoInstall

formdata-node

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formdata-node - npm Package Compare versions

Comparing version 4.3.3 to 4.4.0

@type/isBlob.d.ts

2

@type/File.d.ts

@@ -40,2 +40,3 @@ import { Blob, BlobParts as FileBits, BlobPropertyBag } from "./Blob";

#private;
static [Symbol.hasInstance](value: unknown): value is File;
/**

@@ -51,3 +52,4 @@ * Creates a new File instance.

get lastModified(): number;
get webkitRelativePath(): string;
get [Symbol.toStringTag](): string;
}

@@ -34,2 +34,7 @@ "use strict";

}
static [(_File_name = new WeakMap(), _File_lastModified = new WeakMap(), Symbol.hasInstance)](value) {
return value instanceof Blob_1.Blob
&& value[Symbol.toStringTag] === "File"
&& typeof value.name === "string";
}
get name() {

@@ -41,3 +46,6 @@ return __classPrivateFieldGet(this, _File_name, "f");

}
get [(_File_name = new WeakMap(), _File_lastModified = new WeakMap(), Symbol.toStringTag)]() {
get webkitRelativePath() {
return "";
}
get [Symbol.toStringTag]() {
return "File";

@@ -44,0 +52,0 @@ }

17

lib/cjs/FormData.js

@@ -13,2 +13,3 @@ "use strict";

const isFile_1 = require("./isFile");
const isBlob_1 = require("./isBlob");
const isFunction_1 = require("./isFunction");

@@ -106,8 +107,12 @@ const deprecateConstructorEntries_1 = require("./deprecateConstructorEntries");

if ((0, isFile_1.isFile)(rawValue)) {
if (fileName === undefined) {
fileName = rawValue.name === undefined ? "blob" : rawValue.name;
}
value = new File_1.File([rawValue], String(fileName), {
type: rawValue.type,
lastModified: rawValue.lastModified
value = fileName === undefined
? rawValue
: new File_1.File([rawValue], fileName, {
type: rawValue.type,
lastModified: rawValue.lastModified
});
}
else if ((0, isBlob_1.isBlob)(rawValue)) {
value = new File_1.File([rawValue], fileName === undefined ? "blob" : fileName, {
type: rawValue.type
});

@@ -114,0 +119,0 @@ }

@@ -31,2 +31,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

}
static [(_File_name = new WeakMap(), _File_lastModified = new WeakMap(), Symbol.hasInstance)](value) {
return value instanceof Blob
&& value[Symbol.toStringTag] === "File"
&& typeof value.name === "string";
}
get name() {

@@ -38,5 +43,8 @@ return __classPrivateFieldGet(this, _File_name, "f");

}
get [(_File_name = new WeakMap(), _File_lastModified = new WeakMap(), Symbol.toStringTag)]() {
get webkitRelativePath() {
return "";
}
get [Symbol.toStringTag]() {
return "File";
}
}

@@ -10,2 +10,3 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {

import { isFile } from "./isFile.js";
import { isBlob } from "./isBlob.js";
import { isFunction } from "./isFunction.js";

@@ -103,8 +104,12 @@ import { deprecateConstructorEntries } from "./deprecateConstructorEntries.js";

if (isFile(rawValue)) {
if (fileName === undefined) {
fileName = rawValue.name === undefined ? "blob" : rawValue.name;
}
value = new File([rawValue], String(fileName), {
type: rawValue.type,
lastModified: rawValue.lastModified
value = fileName === undefined
? rawValue
: new File([rawValue], fileName, {
type: rawValue.type,
lastModified: rawValue.lastModified
});
}
else if (isBlob(rawValue)) {
value = new File([rawValue], fileName === undefined ? "blob" : fileName, {
type: rawValue.type
});

@@ -111,0 +116,0 @@ }

{
"name": "formdata-node",
"version": "4.3.3",
"version": "4.4.0",
"description": "Spec-compliant FormData implementation for Node.js",

@@ -65,5 +65,3 @@ "repository": "octet-stream/form-data",

"prepare": "npm run cleanup && npm run build",
"_postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
"husky": "husky install"
},

@@ -78,3 +76,3 @@ "devDependencies": {

"ava": "4.0.1",
"c8": "7.11.0",
"c8": "7.12.0",
"eslint": "7.32.0",

@@ -88,3 +86,2 @@ "eslint-config-airbnb-typescript": "12.3.1",

"lint-staged": "12.3.4",
"pinst": "3.0.0",
"rimraf": "^3.0.2",

@@ -98,4 +95,4 @@ "sinon": "13.0.1",

"node-domexception": "1.0.0",
"web-streams-polyfill": "4.0.0-beta.1"
"web-streams-polyfill": "4.0.0-beta.2"
}
}

@@ -429,2 +429,6 @@ # FormData

### Husky installation
This package is using `husky` to perform git hooks on developer's machine, so your changes might be verified before you push them to `GitHub`. If you want to install these hooks, run `npm run husky` command.
## Related links

@@ -431,0 +435,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc