mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
lodash: signatures of the method _.keys have been changed
This commit is contained in:
+21
-8
@@ -6116,15 +6116,28 @@ module TestHas {
|
||||
result = _({}).invert<TResult>(true).value();
|
||||
}
|
||||
|
||||
class Stooge {
|
||||
constructor(
|
||||
public name: string,
|
||||
public age: number
|
||||
) { }
|
||||
}
|
||||
// _.keys
|
||||
module TestKeys {
|
||||
let object: _.Dictionary<any>;
|
||||
|
||||
result = <string[]>_.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
result = <string[]>_({ 'one': 1, 'two': 2, 'three': 3 }).keys().value();
|
||||
{
|
||||
let result: string[];
|
||||
|
||||
result = _.keys(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string>;
|
||||
|
||||
result = _(object).keys();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string>;
|
||||
|
||||
result = _(object).chain().keys();
|
||||
}
|
||||
}
|
||||
|
||||
result = <string[]>_.keysIn({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
result = <string[]>_({ 'one': 1, 'two': 2, 'three': 3 }).keysIn().value();
|
||||
|
||||
Vendored
+15
-7
@@ -10653,18 +10653,26 @@ declare module _ {
|
||||
//_.keys
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array composed of the own enumerable property names of an object.
|
||||
* @param object The object to inspect.
|
||||
* @return An array of property names.
|
||||
**/
|
||||
* Creates an array of the own enumerable property names of object.
|
||||
*
|
||||
* @param object The object to query.
|
||||
* @return Returns the array of property names.
|
||||
*/
|
||||
keys(object?: any): string[];
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.keys
|
||||
**/
|
||||
keys(): LoDashImplicitArrayWrapper<string>
|
||||
* @see _.keys
|
||||
*/
|
||||
keys(): LoDashImplicitArrayWrapper<string>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.keys
|
||||
*/
|
||||
keys(): LoDashExplicitArrayWrapper<string>;
|
||||
}
|
||||
|
||||
//_.keysIn
|
||||
|
||||
Reference in New Issue
Block a user