Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Latest commit

 

History

History
37 lines (29 loc) · 509 Bytes

README.md

File metadata and controls

37 lines (29 loc) · 509 Bytes

Build Status

defaults

Merge recursively objects into a new one, only if prop's key is not already defined.

Installation

$ yarn add stluafed

API

defaults(...objects)

defaults(
  {
    x: 1,
    z: {
      a: 11
    }
  },
  {
    x: 2,
    y: 2,
    z: {
      a: 'trololol',
      b: 22
    }
  },
  true
);
// > {x: 1, y: 2, z: {a: 11, b: 22}}

License

MIT