From c103b909b2b4a12be5bd6437149115f31268a63a Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 1 Feb 2019 13:48:43 -0800 Subject: [PATCH] [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source --- test/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/utils.js b/test/utils.js index 999f860d..67ef9369 100644 --- a/test/utils.js +++ b/test/utils.js @@ -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' } });