Socket
Socket
Sign inDemoInstall

form-data-to-object

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    form-data-to-object

Converts application/x-www-form-urlencoded keys to plain JS object


Version published
Weekly downloads
29K
increased by14.64%
Maintainers
1
Install size
5.54 kB
Created
Weekly downloads
 

Readme

Source

form-data-to-object

Converts application/x-www-form-urlencoded data structure to plain JS object

API

  • formData.toObj() - Converts keys in x-www-form-urlencoded format on an object to a normal object
  • formData.fromObj() - Converts a normal object to object with keys in x-www-form-urlencoded format

// keys in x-www-form-urlencoded format
{
  'foo': 'bar',
  'foo2[name]': 'bar2',
  'foo3[0]': 'bar3',
  'foo3[1][name]': 'bar4'
}

// converts from/to

// normal object
{
  foo: 'bar',
  foo2: {
    name: 'bar2'
  },
  foo3: ['bar3', {
    name: 'bar4'
  }]
}

Keywords

FAQs

Last updated on 07 Jul 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc