Skip to content

Commit

Permalink
Merge pull request #57 from williamboman/docs/fix-js-formatting
Browse files Browse the repository at this point in the history
README: MDN-style formatting on JavaScript blocks
  • Loading branch information
TehShrike committed Jan 27, 2017
2 parents bfc85d8 + 60efb50 commit fddfbb9
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,38 @@ var merge = require('./')
-->

```js
var x = { foo: { bar: 3 },
array: [ { does: 'work', too: [ 1, 2, 3 ] } ] }
var y = { foo: { baz: 4 },
quux: 5,
array: [ { does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' } ] }

var expected = { foo: { bar: 3, baz: 4 },
array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ],
quux: 5 }
var x = {
foo: { bar: 3 },
array: [{
does: 'work',
too: [ 1, 2, 3 ]
}]
}

var y = {
foo: { baz: 4 },
quux: 5,
array: [{
does: 'work',
too: [ 4, 5, 6 ]
}, {
really: 'yes'
}]
}

var expected = {
foo: {
bar: 3,
baz: 4
},
array: [{
does: 'work',
too: [ 1, 2, 3, 4, 5, 6 ]
}, {
really: 'yes'
}],
quux: 5
}

merge(x, y) // => expected
```
Expand Down

0 comments on commit fddfbb9

Please sign in to comment.