🤖 Merge PR #63337 fix: deep-extend: call the function with only one object by @pulsovi

Co-authored-by: David GABISON <david.gabison@outlook.com>
This commit is contained in:
pulsovi
2022-11-21 04:33:43 +01:00
committed by GitHub
parent 174c986b20
commit 3a54cb6c56
2 changed files with 4 additions and 1 deletions

View File

@@ -35,3 +35,4 @@ deepExtend(obj1, obj1, obj1, obj1, obj1, obj1); // More than 5 arguments
deepExtend({ a: 1 }, { b: true }); // $ExpectType { a: number; } & { b: boolean; }
// @ts-expect-error
deepExtend({ a: 1 }, 1);
deepExtend({ a: 1 }); // $ExpectType { a: number; }

View File

@@ -1,9 +1,11 @@
// Type definitions for deep-extend 0.4
// Type definitions for deep-extend 0.6
// Project: https://github.com/unclechu/node-deep-extend
// Definitions by: rhysd <https://github.com/rhysd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.9
/** Recursive object extending. */
declare function deepExtend<T extends object>(target: T): T;
declare function deepExtend<T extends object, U extends object>(target: T, source: U): T & U;
declare function deepExtend<T extends object, U extends object, V extends object>(
target: T,