mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 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:
@@ -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; }
|
||||
|
||||
4
types/deep-extend/index.d.ts
vendored
4
types/deep-extend/index.d.ts
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user