File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11# json-multilevel-delta [ ![ Build Status] ( https://travis-ci.org/sebastianroming/json-multilevel-delta.svg?branch=master )] ( https://travis-ci.org/sebastianroming/json-multilevel-delta )
22
3- > Compare two objects and return the difference (keys)
3+ > Compare two objects and return the difference
44
55## Install
66```
Original file line number Diff line number Diff line change 11import test from 'ava' ;
2+ import m from '.' ;
23
3- test ( 'test' , t => {
4- t . is ( 'x' , 'x' ) ;
4+ const objectA = { 'a' : 'b' , 'c' : 'd' } ;
5+ const objectB = { 'c' : 'd' } ;
6+
7+ test ( 'detect the delta length' , t => {
8+ t . is ( m ( objectA , objectB ) . length , 1 ) ;
9+ } ) ;
10+
11+ test ( 'detect the correct delta object' , t => {
12+ t . deepEqual ( m . json ( objectA , objectB ) , { 'a' : 'b' } ) ;
513} ) ;
You can’t perform that action at this time.
0 commit comments