Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 696 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 696 Bytes

extern-js-merge

  • Target : Javascript (NodeJS + Browser)
  • Library : merge
  • Last tested version : 1.2.0
  • Available on : Github - NPM

Usage

import js.merge.*;

class Main
{
  static function main()
  {
    var original, cloned;

    trace(Merge.merge({ one:'hello' }, { two: 'world' }));
    // -> {"one": "hello", "two": "world"}

    original = { x: { y: 1 } };
    cloned = Merge.merge(true, original);
    cloned.x.y++;

    trace(original.x.y, cloned.x.y);
    // -> 1, 2

    trace(Merge.recursive(true, original, { x: { z: 2 } }));
    // -> {"x": { "y": 1, "z": 2 } }
  }
}