JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q69769F

Package Exports

  • smart-merge

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (smart-merge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Merge multiple Javascript objects

Deep merge any number of javascript objects.

NPM

install

npm install smart-merge

Usage

    var baseStyles = {
        header: {
            left: 10,
            position: 'absolute',
        },
        footer: {
            right: 10
        }
    };
    var rtlStyles = {
        header: {
            left: 40,
        }
    };
    var merge = require('smart-merge');
    merge(baseStyles, rtlStyles);

Result

{ 
    header:{ 
        left: 40, 
        position: 'absolute' 
    }, 
    footer:{ 
        right: 10 
    } 
}

Tests

Check the tests for more examples...