Skip to content

Commit c103b90

Browse files
committed
[Fix] utils.merge`: avoid a crash with a null target and a truthy non-array source
1 parent 563588d commit c103b90

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ var test = require('tape');
44
var utils = require('../lib/utils');
55

66
test('merge()', function (t) {
7+
t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');
8+
79
t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
810

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

0 commit comments

Comments
 (0)