From 878a9a29e77bcaedd4242618ccf57d1be7dfd7d8 Mon Sep 17 00:00:00 2001 From: Axetroy Date: Thu, 12 Sep 2019 11:31:23 +0800 Subject: bump prettier to 1.18.2 (denoland/deno_std#592) Original: https://github.com/denoland/deno_std/commit/06958a4ada960665a48ac34f919423e0d8d16951 --- util/deep_assign.ts | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'util/deep_assign.ts') diff --git a/util/deep_assign.ts b/util/deep_assign.ts index 1dfc00a5b..b1c9f9ac9 100644 --- a/util/deep_assign.ts +++ b/util/deep_assign.ts @@ -8,26 +8,24 @@ export function deepAssign( if (!source || typeof source !== `object`) { return; } - Object.entries(source).forEach( - ([key, value]: [string, unknown]): void => { - if (value instanceof Date) { - target[key] = new Date(value); - return; - } - if (!value || typeof value !== `object`) { - target[key] = value; - return; - } - if (Array.isArray(value)) { - target[key] = []; - } - // value is an Object - if (typeof target[key] !== `object` || !target[key]) { - target[key] = {}; - } - deepAssign(target[key] as Record, value!); + Object.entries(source).forEach(([key, value]: [string, unknown]): void => { + if (value instanceof Date) { + target[key] = new Date(value); + return; } - ); + if (!value || typeof value !== `object`) { + target[key] = value; + return; + } + if (Array.isArray(value)) { + target[key] = []; + } + // value is an Object + if (typeof target[key] !== `object` || !target[key]) { + target[key] = {}; + } + deepAssign(target[key] as Record, value!); + }); } return target; } -- cgit v1.2.3