Merge pull request #6789 from chrootsu/lodash-keys

lodash: signatures of the method _.keys have been changed
This commit is contained in:
Masahiro Wakame
2015-11-19 23:23:05 +09:00
2 changed files with 36 additions and 15 deletions
+21 -8
View File
@@ -6151,15 +6151,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();
+15 -7
View File
@@ -10666,18 +10666,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