Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash-extendall

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-extendall

Extend Lodash to allow all objects in an array of objects to be extended i.e. to have new properties added or existing properties updated.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Lodash extendall

Build Status Known Vulnerabilities NPM version

Extend Lodash to allow all objects in an array of objects to be extended i.e. to have new properties added or existing properties updated based on input object properties. Returns a new array with the original array left unchanged.
Does minimal checking of inputs; assumes the array is an array of objects.

_.extendAll(arr, obj)

Arguments
arr (array): The array of objects to be extended. Required.
obj (object): The object to be used to extend each object in the array. Where a property in this object doesn't exist in the array object it will be added. Where it does exist it will be replaced.

Returns
(array): An new array of extended objects.

Examples

var _ = require('lodash')
require('lodash-extendall')

_.extendAll([{a:1, b:2},{a:3, b:4}], {x:'new1', y:'new2'}) // [{a:1, b:2, x:'new1', y:'new2'},{a:3, b:4, x:'new1', y:'new2'}]
_.extendAll([{a:1, b:2},{a:3, b:4}], {a:999, x:'new1'}) // [{a:999, b:2, x:'new1'},{a:999, b:4, x:'new1'}]
_.extendAll([{a:1, b:2},{a:3, b:4}], {}}) // [{a:1, b:2},{a:3, b:4}]
_.extendAll([{a:1, b:2},{a:3, b:4}], ['abc']) // [{a:1, b:2},{a:3, b:4}]
_.extendAll([]], {a:false, x:false}) // []
_.extendAll([{a:1, b:2},{a:3}], {b:false}) // [{a:1, b:false},{a:3, b:false}]

Version History

VersionRelease DateDetails
1.0.227th February, 2018Update the Version History. No functionality changes.
1.0.127th February, 2018Fix layout issues with Examples in the README. No functionality changes.
1.0.026th February, 2018Initial release.

FAQs

Package last updated on 27 Feb 2018

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

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