1.0.0 • Published 8 years ago

@cfpb/object-assign v1.0.0

Weekly downloads
1
License
CC0-1.0
Repository
github
Last release
8 years ago

object-assign

Utility used to copy Javascript object properties from one or more source objects to a target object

Example

JS

var assert = require( 'assert' );
var assign = require( 'object-assign' ).assign;
var testObjectA = {
    str:  'test',
    func: function() { return 'testStr'; },
    num:  1
 };
 var testObjectB = {
    obj:   { test: 2 },
    arr:   [ 3 ],
   	_null: null
 };
 assign( testObjectA, testObjectB );
 assert( testObjectA.hasOwnProperty( 'obj' ), true ) ;
 assert( testObjectA.hasOwnProperty( 'arr' ) );
 assert( testObjectA.hasOwnProperty( '_null' ), true );

Installation

npm install @cfpb/object-assign

Contributing

We welcome your feedback and contributions. See the contribution guidelines for more details.

Additionally, you may want to consider contributing to the Capital Framework, which is the front-end pattern library used in this project.

Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy