node package manager

extendr

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

extendr


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

  • Install: npm install --save extendr
  • Use: require('extendr')
    • Install: npm install --save extendr
    • Use: require('extendr')
    • CDN URL: //wzrd.in/bundle/extendr@3.1.0
      • Install: ender add extendr
      • Use: require('extendr')
        • 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)
        • 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.

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

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

        These amazing people are maintaining this project:

        No sponsors yet! Will you be the first?

        These amazing people have contributed code to this project:

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

        Unless stated otherwise all works are:

        and licensed under: