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

extendr

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extendr

Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways

  • 3.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44K
increased by1.34%
Maintainers
1
Weekly downloads
 
Created
Source

extendr

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Slack community badge Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways

Install

NPM

  • Install: npm install --save extendr
  • Module: require('extendr')

Browserify

  • Install: npm install --save extendr
  • Module: require('extendr')
  • CDN URL: //wzrd.in/bundle/extendr@3.2.0

Ender

  • Install: ender add extendr
  • Module: require('extendr')

Editions

This package is published with the following editions:

  • extendr aliases extendr/index.js which uses Editions to automatically select the correct edition for the consumers environment
  • extendr/source/index.js is Source + ESNext + Require
  • extendr/es2015/index.js is Babel Compiled + ES2015 + Require

Older environments may need Babel's Polyfill or something similar.

Usage

API

  • require('extendr').extend(target, ...objects) - shallow extend the properties from the objects into the target
  • require('extendr').deep(target, ...objects) - deep extend the properties from the objects into the target
  • require('extendr').defaults(target, ...objects) - shallow extend the properties from the objects into the target where the target's value is undefined or null
  • require('extendr').deepDefaults(target, ...objects) - deep extend the properties from the objects into the target where the target's value is undefined or null
  • require('extendr').clone(...objects) - deep extend the properties from the objects into a new object
  • require('extendr').dereferenceJSON(object) - clones the object by stringifg it, then parsing the result, to ensure all references are destroyed (objects that not plain objects or arrays will be lost)

Implementation

  • Extendr arguments can only be plain JavaScript objects, anything else will throw. This is intentional to guarantee consistency of references.
  • Object property values that are plain objects or arrays will be dereferenced. All other object types will keep their reference.

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Patreon donate button Gratipay donate button Flattr donate button PayPal donate button Bitcoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

Keywords

FAQs

Package last updated on 27 May 2016

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