From 048086c7641011aa7c89da4ca0835b17ea3ce841 Mon Sep 17 00:00:00 2001 From: erikpham Date: Thu, 4 Apr 2024 07:41:13 +0700 Subject: [PATCH] refactor: merge deep options when create fetch (#1) * refactor: merge deep options when create fetch --- src/utils/option.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/utils/option.ts b/src/utils/option.ts index a4ce161..33f3f7f 100644 --- a/src/utils/option.ts +++ b/src/utils/option.ts @@ -4,7 +4,7 @@ import type { GoogleFontsFetchOptions, ResolvedGoogleFontsFetchOptions, } from '../types' -import { extend } from './common' +import { extend, mergeDeep } from './common' /** * Normalize Google Font Helper options @@ -39,11 +39,10 @@ export function normalizeOptions(options?: GoogleFontsFetchOptions): ResolvedGoo outDir: './output/fonts', }, } - return extend( - {}, + return mergeDeep( base, options || {}, - ) + ) as ResolvedGoogleFontsFetchOptions } /**