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.4.0 to 1.4.1

14

form-urlencoded.js

@@ -9,10 +9,14 @@ // Filename: formurlencoded.js

var formurlencoded = module.exports = function (data, opts) {
// ES5 compatible version of `/[^ !'()~\*]/gu`, https://mothereff.in/regexpu
var encodechar = new RegExp([
'(?:[\0-\x1F"-&\+-\}\x7F-\uD7FF\uE000-\uFFFF]|',
'[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|',
'(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])'
].join(''), 'g');
opts = typeof opts === 'object' ? opts : {};
function encode (value) {
return String(value)
// The following is an ES5 compatible version of .replace(/[^ !'()~\*]/gu, encodeURIComponent)
// Thanks to https://mothereff.in/regexpu
.replace(/(?:[\0-\x1F"-&\+-\}\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, encodeURIComponent)
.replace(encodechar, encodeURIComponent)
.replace(/ /g, '+')

@@ -19,0 +23,0 @@ .replace(/[!'()~\*]/g, function (ch) {

{
"name": "form-urlencoded",
"main": "form-urlencoded",
"version": "1.4.0",
"version": "1.4.1",
"description": "Return an object as an 'x-www-form-urlencoded' string",

@@ -6,0 +6,0 @@ "author": "Chris <chris@bumblehead.com>",

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