Socket
Book a DemoInstallSign in
Socket

concat-object

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concat-object

Concatenate object property values into arrays

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

concat-object Build Status

Concatenate object property values into arrays

Useful for creating form data objects that could easily be turned into query strings.

Install

$ npm install concat-object

Usage

const querystring = require('querystring');
const concatObject = require('concat-object');

concatObject({a: 'foo'}, {a: 'bar', b: 'unicorn'}, {b: ['foo']});
//=> {a: ['foo', 'bar'], b: ['unicorn', ['foo']]}

querystring.stringify(concatObject({a: 'foo'}, {a: 'bar'}));
//=> 'a=foo&a=bar'

API

concatObject(object, [object, ...])

object

Type: Object

Assigns properties of object into arrays in a new object.

License

MIT © Kevin Martensson

Keywords

array

FAQs

Package last updated on 05 Jul 2017

Did you know?

Socket

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