From ca450e46059b713f5d776afacdc7cdca6650f090 Mon Sep 17 00:00:00 2001 From: Dany Castillo <31006608+dcastil@users.noreply.github.com> Date: Sun, 20 Aug 2023 18:43:52 +0200 Subject: [PATCH] allow passing single generic argument to mergeConfigs --- src/lib/merge-configs.ts | 2 +- tests/type-generics.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/merge-configs.ts b/src/lib/merge-configs.ts index 8eb947a8..df2d765f 100644 --- a/src/lib/merge-configs.ts +++ b/src/lib/merge-configs.ts @@ -4,7 +4,7 @@ import { ConfigExtension, GenericConfig } from './types' * @param baseConfig Config where other config will be merged into. This object will be mutated. * @param configExtension Partial config to merge into the `baseConfig`. */ -export function mergeConfigs( +export function mergeConfigs( baseConfig: GenericConfig, { cacheSize, diff --git a/tests/type-generics.test.ts b/tests/type-generics.test.ts index c0993b29..07a46e59 100644 --- a/tests/type-generics.test.ts +++ b/tests/type-generics.test.ts @@ -169,4 +169,8 @@ test('mergeConfigs type generics work correctly', () => { const config2 = mergeConfigs<'very', 'strict'>(getDefaultConfig(), {}) expect(config2).toEqual(expect.any(Object)) + + const config3 = mergeConfigs<'single-arg'>(getDefaultConfig(), {}) + + expect(config3).toEqual(expect.any(Object)) })