@jswork/next-deep-assign

Deep assign for next.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@jswork/next-deep-assign
1.0.22 years ago2 years agoMinified + gzip package size for @jswork/next-deep-assign in KB

Readme

next-deep-assign
Deep assign for next.

!versionversion-imageversion-url !licenselicense-imagelicense-url !sizesize-imagesize-url !downloaddownload-imagedownload-url

installation

npm install -S @jswork/next-deep-assign

usage

import '@jswork/next-deep-assign';

const obj1 = {
  lineHeight: 26,
  left: 'center',
  style: {
    items: ['a'],
    fontSize: 24,
    fill: '#333',
    fontWeight: 500
  }
};

const obj2 = {
  lineHeight: 100,
  left: null,
  style: {
    items: [1, 2, 3],
    fontFamily: 'Arial'
  }
};

const result = nx.deepAssign(obj1, obj2);

// result
{
  lineHeight: 100,
  left: null,
  style: {
    items: [1, 2, 3],
    fontSize: 24,
    fill: '#333',
    fontWeight: 500,
    fontFamily: 'Arial'
  }
}

license

Code released under the MIT license.