mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #950 from pspi/underscore_omit_fix
Function _.omit() accepts array of strings as well.
This commit is contained in:
@@ -148,7 +148,9 @@ _.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" });
|
||||
_.functions(_);
|
||||
_.extend({ name: 'moe' }, { age: 50 });
|
||||
_.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'name');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age');
|
||||
_.omit({ name: 'moe', age: 50, userid: 'moe1' }, ['name', 'age']);
|
||||
|
||||
var iceCream = { flavor: "chocolate" };
|
||||
_.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" });
|
||||
|
||||
Vendored
+2
-3
@@ -1040,9 +1040,8 @@ declare module _ {
|
||||
* @param keys The key/value pairs to remove on `object`.
|
||||
* @return Copy of `object` without the `keys` properties.
|
||||
**/
|
||||
export function omit(
|
||||
object: any,
|
||||
...keys: string[]): any;
|
||||
export function omit(object: any, ...keys: string[]): any;
|
||||
export function omit(object: any, keys: string[]): any;
|
||||
|
||||
/**
|
||||
* Fill in null and undefined properties in object with values from the defaults objects,
|
||||
|
||||
Reference in New Issue
Block a user