Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octetstream/object-to-form-data

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octetstream/object-to-form-data - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

serialize.d.ts

3

package.json
{
"name": "@octetstream/object-to-form-data",
"version": "0.2.0",
"version": "0.3.0",
"description": "Serialize given object/collection to a FormData.",

@@ -9,2 +9,3 @@ "repository": "https://github.com/octet-stream/object-to-form-data",

"main": "serialize.js",
"types": "serialize.d.ts",
"engines": {

@@ -11,0 +12,0 @@ "node": ">=7.6"

@@ -15,4 +15,4 @@ const FormData = require("./form-data")

*/
function serialize(object, root = null) {
if (!(isArray(object) || isPlainObject(object))) {
function serialize(iterable, root = null) {
if (!(isArray(iterable) || isPlainObject(iterable))) {
throw new TypeError("Expected object or array as the first argument.")

@@ -44,3 +44,3 @@ }

set(root, object)
set(root, iterable)

@@ -47,0 +47,0 @@ return data

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