mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 11:51:10 +08:00
Merge pull request #5571 from maglar0/master
Underscore: Add types for functions extendOwn() and assign()
This commit is contained in:
@@ -177,6 +177,8 @@ _.pairs({ one: 1, two: 2, three: 3 });
|
||||
_.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" });
|
||||
_.functions(_);
|
||||
_.extend({ name: 'moe' }, { age: 50 });
|
||||
_.extendOwn({ name: 'moe'}, { age: 50 });
|
||||
_.assign({ name: 'moe'}, { age: 50 });
|
||||
_.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'name');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age');
|
||||
|
||||
14
underscore/underscore.d.ts
vendored
14
underscore/underscore.d.ts
vendored
@@ -1236,6 +1236,20 @@ interface UnderscoreStatic {
|
||||
destination: any,
|
||||
...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Like extend, but only copies own properties over to the destination object. (alias: assign)
|
||||
*/
|
||||
extendOwn(
|
||||
destination: any,
|
||||
...source: any[]): any;
|
||||
|
||||
/**
|
||||
* Like extend, but only copies own properties over to the destination object. (alias: extendOwn)
|
||||
*/
|
||||
assign(
|
||||
destination: any,
|
||||
...source: any[]): any;
|
||||
|
||||
/**
|
||||
* Return a copy of the object, filtered to only have values for the whitelisted keys
|
||||
* (or array of valid keys).
|
||||
|
||||
Reference in New Issue
Block a user