Skip to content

Commit

Permalink
[Fix] utils.merge`: avoid a crash with a null target and a truthy n…
Browse files Browse the repository at this point in the history
…on-array source
  • Loading branch information
ljharb committed Feb 1, 2019
1 parent 563588d commit c103b90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var test = require('tape');
var utils = require('../lib/utils');

test('merge()', function (t) {
t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');

t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');

var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
Expand Down

0 comments on commit c103b90

Please sign in to comment.