form-urlencoded
Advanced tools
Comparing version 1.2.0 to 1.2.1
// Filename: formurlencoded.js | ||
// Timestamp: 2016.01.18-15:36:37 (last modified) | ||
// Timestamp: 2016.03.07-12:29:28 (last modified) | ||
// Author(s): Bumblehead (www.bumblehead.com), JBlashill (james@blashill.com) | ||
@@ -13,3 +13,3 @@ // | ||
return String(value) | ||
.replace(/[^ !'()~\*]*/g, encodeURIComponent) | ||
.replace(/[^ !'()~\*]/g, encodeURIComponent) | ||
.replace(/ /g, '+') | ||
@@ -60,5 +60,5 @@ .replace(/[!'()~\*]/g, function (ch) { | ||
return filterjoin(keys(data).map(function (key) { | ||
return data && filterjoin(keys(data).map(function (key) { | ||
return nest(key, data[key]); | ||
})); | ||
}; |
{ | ||
"name": "form-urlencoded", | ||
"main": "form-urlencoded", | ||
"version": "1.2.0", | ||
"description": "Return an object as an `x-www-form-urlencoded` string", | ||
"version": "1.2.1", | ||
"description": "Return an object as an 'x-www-form-urlencoded' string", | ||
"author": "Chris <chris@bumblehead.com>", | ||
@@ -7,0 +7,0 @@ "license" : "MIT", |
@@ -7,3 +7,3 @@ form-urlencoded | ||
Returns `x-www-form-urlencoded` string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server. | ||
Returns 'x-www-form-urlencoded' string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server. | ||
@@ -10,0 +10,0 @@ |
// Filename: form-urlencoded.spec.js | ||
// Timestamp: 2016.01.18-16:00:25 (last modified) | ||
// Timestamp: 2016.03.07-12:30:02 (last modified) | ||
// Author(s): bumblehead <chris@bumblehead.com> | ||
@@ -90,2 +90,12 @@ | ||
it("should not break when null argument is given", function () { | ||
expect( | ||
formurlencoded(null, { sorted: true }) | ||
).toBe( null ); | ||
expect( | ||
formurlencoded(undefined, { sorted: true }) | ||
).toBe( undefined ); | ||
}); | ||
it("should properly encode all ascii characters", function () { | ||
@@ -92,0 +102,0 @@ var testCharEncodingString = ""; |
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
11520
175