From 50a79584cb12129b3db1ef3e0eb9d0c8b9f20b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 30 May 2019 14:59:30 +0200 Subject: chore: Implement strict mode (denoland/deno_std#453) Original: https://github.com/denoland/deno_std/commit/be24677d15494e83eea2e99bfc5ccfdde31cb892 --- testing/format.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'testing/format.ts') diff --git a/testing/format.ts b/testing/format.ts index 8ed066eb0..af8391b23 100644 --- a/testing/format.ts +++ b/testing/format.ts @@ -525,16 +525,10 @@ const getConfig = (options: Options): Config => ({ */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function format(val: any, options: Optional = {}): string { - const opts = Object.keys(DEFAULT_OPTIONS).reduce( - (acc: Options, k: keyof Options): unknown => { - const opt = options[k]; - if (typeof opt === "undefined") { - return { ...acc, [k]: DEFAULT_OPTIONS[k] }; - } - return { ...acc, [k]: opt }; - }, - {} - ) as Options; + const opts: Options = { + ...DEFAULT_OPTIONS, + ...options + }; const basicResult = printBasicValue(val, opts); if (basicResult !== null) { return basicResult; -- cgit v1.2.3