Skip to content

mpyan/candybar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

candybar

Unwraps all arrays in an array of JSON objects and replaces each array with their first element. Great for handling objects containing single-element arrays.

Install

npm install candybar

Usage

var candybar = require('candybar');

var arr = [{foo: "hi", bar: ["bar"]}, {foo: ["hello"], bar: "world"}];

candybar.unwrap(arr); // => arr = [{foo: "hi", bar: "bar"}, {foo: "hello", bar: "world"}];

About

candybar: unwrap arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published