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

object-to-formdata

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-to-formdata - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

2

dist/index.js

@@ -1,2 +0,2 @@

function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}var e=function(n){return void 0===n},t=function(n){return Array.isArray(n)},o=function(n){return n&&"number"==typeof n.size&&"string"==typeof n.type&&"function"==typeof n.slice};export default function i(r,f,u,s){if((f=f||{}).indices=!e(f.indices)&&f.indices,f.nullsAsUndefined=!e(f.nullsAsUndefined)&&f.nullsAsUndefined,u=u||new FormData,e(r))return u;if(null===r)f.nullsAsUndefined||u.append(s,"");else if(t(r))if(r.length)r.forEach(function(n,e){var t=s+"["+(f.indices?e:"")+"]";i(n,f,u,t)});else{var l=s+"[]";u.append(l,"")}else!function(n){return n instanceof Date}(r)?!function(n){return n===Object(n)}(r)||function(e){return o(e)&&"string"==typeof e.name&&("object"===n(e.lastModifiedDate)||"number"==typeof e.lastModified)}(r)||o(r)?u.append(s,r):Object.keys(r).forEach(function(n){var e=r[n];if(t(e))for(;n.length>2&&n.lastIndexOf("[]")===n.length-2;)n=n.substring(0,n.length-2);i(e,f,u,s?s+"["+n+"]":n)}):u.append(s,r.toISOString());return u}
function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}var e=function(n){return void 0===n},t=function(n){return Array.isArray(n)},o=function(n){return n&&"number"==typeof n.size&&"string"==typeof n.type&&"function"==typeof n.slice};export default function i(r,f,u,s){if((f=f||{}).indices=!e(f.indices)&&f.indices,f.nullsAsUndefineds=!e(f.nullsAsUndefineds)&&f.nullsAsUndefineds,u=u||new FormData,e(r))return u;if(null===r)f.nullsAsUndefineds||u.append(s,"");else if(t(r))if(r.length)r.forEach(function(n,e){var t=s+"["+(f.indices?e:"")+"]";i(n,f,u,t)});else{var l=s+"[]";u.append(l,"")}else!function(n){return n instanceof Date}(r)?!function(n){return n===Object(n)}(r)||function(e){return o(e)&&"string"==typeof e.name&&("object"===n(e.lastModifiedDate)||"number"==typeof e.lastModified)}(r)||o(r)?u.append(s,r):Object.keys(r).forEach(function(n){var e=r[n];if(t(e))for(;n.length>2&&n.lastIndexOf("[]")===n.length-2;)n=n.substring(0,n.length-2);i(e,f,u,s?s+"["+n+"]":n)}):u.append(s,r.toISOString());return u}
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n=n||self).objectToFormData=e()}(this,function(){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}var e=function(n){return void 0===n},t=function(n){return Array.isArray(n)},o=function(n){return n&&"number"==typeof n.size&&"string"==typeof n.type&&"function"==typeof n.slice};return function i(f,r,u,s){if((r=r||{}).indices=!e(r.indices)&&r.indices,r.nullsAsUndefined=!e(r.nullsAsUndefined)&&r.nullsAsUndefined,u=u||new FormData,e(f))return u;if(null===f)r.nullsAsUndefined||u.append(s,"");else if(t(f))if(f.length)f.forEach(function(n,e){var t=s+"["+(r.indices?e:"")+"]";i(n,r,u,t)});else{var c=s+"[]";u.append(c,"")}else!function(n){return n instanceof Date}(f)?!function(n){return n===Object(n)}(f)||function(e){return o(e)&&"string"==typeof e.name&&("object"===n(e.lastModifiedDate)||"number"==typeof e.lastModified)}(f)||o(f)?u.append(s,f):Object.keys(f).forEach(function(n){var e=f[n];if(t(e))for(;n.length>2&&n.lastIndexOf("[]")===n.length-2;)n=n.substring(0,n.length-2);i(e,r,u,s?s+"["+n+"]":n)}):u.append(s,f.toISOString());return u}});
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n=n||self).objectToFormData=e()}(this,function(){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}var e=function(n){return void 0===n},t=function(n){return Array.isArray(n)},o=function(n){return n&&"number"==typeof n.size&&"string"==typeof n.type&&"function"==typeof n.slice};return function i(f,r,u,s){if((r=r||{}).indices=!e(r.indices)&&r.indices,r.nullsAsUndefineds=!e(r.nullsAsUndefineds)&&r.nullsAsUndefineds,u=u||new FormData,e(f))return u;if(null===f)r.nullsAsUndefineds||u.append(s,"");else if(t(f))if(f.length)f.forEach(function(n,e){var t=s+"["+(r.indices?e:"")+"]";i(n,r,u,t)});else{var c=s+"[]";u.append(c,"")}else!function(n){return n instanceof Date}(f)?!function(n){return n===Object(n)}(f)||function(e){return o(e)&&"string"==typeof e.name&&("object"===n(e.lastModifiedDate)||"number"==typeof e.lastModified)}(f)||o(f)?u.append(s,f):Object.keys(f).forEach(function(n){var e=f[n];if(t(e))for(;n.length>2&&n.lastIndexOf("[]")===n.length-2;)n=n.substring(0,n.length-2);i(e,r,u,s?s+"["+n+"]":n)}):u.append(s,f.toISOString());return u}});
//# sourceMappingURL=umd.js.map

@@ -7,3 +7,3 @@ export = objectToFormData;

indices?: boolean;
nullsAsUndefined?: boolean;
nullsAsUndefineds?: boolean;
},

@@ -10,0 +10,0 @@ fd?: FormData,

{
"name": "object-to-formdata",
"version": "2.1.1",
"version": "2.1.2",
"repository": "therealparmesh/object-to-formdata",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -29,3 +29,3 @@ # object-to-formdata

*/
nullsAsUndefined: false,
nullsAsUndefineds: false,
};

@@ -32,0 +32,0 @@

@@ -26,3 +26,3 @@ const isUndefined = value => value === undefined

cfg.indices = isUndefined(cfg.indices) ? false : cfg.indices
cfg.nullsAsUndefined = isUndefined(cfg.nullsAsUndefined) ? false : cfg.nullsAsUndefined
cfg.nullsAsUndefineds = isUndefined(cfg.nullsAsUndefineds) ? false : cfg.nullsAsUndefineds
fd = fd || new FormData()

@@ -33,3 +33,3 @@

} else if (isNull(obj)) {
if (!cfg.nullsAsUndefined) {
if (!cfg.nullsAsUndefineds) {
fd.append(pre, '')

@@ -36,0 +36,0 @@ }

@@ -28,3 +28,3 @@ import objectToFormData from '.'

test('null with nullsAsUndefined option', () => {
test('null with nullsAsUndefineds option', () => {
const formData = objectToFormData(

@@ -35,3 +35,3 @@ {

{
nullsAsUndefined: true
nullsAsUndefineds: true
}

@@ -38,0 +38,0 @@ )

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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