From 3f2bfb19c9496bb08e8bb956038a106b4fd3d66d Mon Sep 17 00:00:00 2001 From: ErikPham Date: Thu, 4 Apr 2024 07:34:12 +0700 Subject: [PATCH 1/2] refactor: merge deep options when create fetch --- src/utils/option.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/option.ts b/src/utils/option.ts index a4ce161..2a9fa49 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,8 +39,7 @@ export function normalizeOptions(options?: GoogleFontsFetchOptions): ResolvedGoo outDir: './output/fonts', }, } - return extend( - {}, + return mergeDeep( base, options || {}, ) From 9af322ab0c7913cc06252a35274a133a23ba7adb Mon Sep 17 00:00:00 2001 From: ErikPham Date: Thu, 4 Apr 2024 07:39:16 +0700 Subject: [PATCH 2/2] chore(options): merge deep options when create fetch --- src/utils/option.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/option.ts b/src/utils/option.ts index 2a9fa49..33f3f7f 100644 --- a/src/utils/option.ts +++ b/src/utils/option.ts @@ -4,7 +4,7 @@ import type { GoogleFontsFetchOptions, ResolvedGoogleFontsFetchOptions, } from '../types' -import {extend, mergeDeep} from './common' +import { extend, mergeDeep } from './common' /** * Normalize Google Font Helper options @@ -42,7 +42,7 @@ export function normalizeOptions(options?: GoogleFontsFetchOptions): ResolvedGoo return mergeDeep( base, options || {}, - ) + ) as ResolvedGoogleFontsFetchOptions } /**