Socket
Socket
Sign inDemoInstall

form-urlencoded

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-urlencoded - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

30

form-urlencoded.js

@@ -5,2 +5,3 @@ // Filename: formurlencoded.js

//
// 5.1, http://www.w3.org/TR/html5/forms.html#url-encoded-form-data
// input: {one:1,two:2} return: '[one]=1&[two]=2'

@@ -12,2 +13,8 @@

optsorted = opts.sorted || false;
function getKeys(obj) {
var keys = Object.keys(obj);
return optsorted ? keys.sort() : keys;
}

@@ -20,8 +27,2 @@ function getNestValsArrAsStr(arr) {

function getKeys(obj) {
var keys = Object.keys(obj);
return optsorted ? keys.sort() : keys;
}
function getObjNestVals (name, obj) {

@@ -53,4 +54,4 @@ var objKeyStr = ':name[:prop]';

if (Array.isArray(value)) {
f = getArrNestVals(name, value);
if (value === null) {
f = optignorenull ? f : encode(name) + '=' + f;
} else if (type === 'string') {

@@ -62,8 +63,6 @@ f = encode(name) + '=' + formEncodeString(value);

f = encode(name) + '=' + value;
} else if (Array.isArray(value)) {
f = getArrNestVals(name, value);
} else if (type === 'object') {
if (value !== null) {
f = getObjNestVals(name, value);
} else if (!optignorenull) {
f = encode(name) + '=null';
}
f = getObjNestVals(name, value);
}

@@ -74,6 +73,5 @@

// 5.1, http://www.w3.org/TR/html5/forms.html#url-encoded-form-data
function manuallyEncodeChar (ch) {
return '%' + ('0' + ch.charCodeAt(0).toString(16)).slice(-2).toUpperCase();
};
}

@@ -85,3 +83,3 @@ function formEncodeString (value) {

.replace(/[!'()~\*]/g, manuallyEncodeChar);
};
}

@@ -88,0 +86,0 @@ return getNestValsArrAsStr(getKeys(data).map(function (key) {

{
"name": "form-urlencoded",
"main": "form-urlencoded",
"version": "1.0.0",
"version": "1.0.1",
"author": "Chris <chris@bumblehead.com>",

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

@@ -175,2 +175,3 @@ var formurlencoded = require('../form-urlencoded'),

});
});
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