Merge pull request #5546 from chrootsu/lodash-isObject

lodash: changed _.isObject() method
This commit is contained in:
Masahiro Wakame
2015-09-03 02:30:28 +09:00
2 changed files with 24 additions and 15 deletions

View File

@@ -1284,6 +1284,12 @@ result = <boolean>_(1).isNumber();
result = <boolean>_<any>([]).isNumber();
result = <boolean>_({}).isNumber();
// _.isObject
result = <boolean>_.isObject(any);
result = <boolean>_(1).isObject();
result = <boolean>_<any>([]).isObject();
result = <boolean>_({}).isObject();
// _.isPlainObject
result = <boolean>_.isPlainObject(any);
result = <boolean>_(1).isPlainObject();
@@ -1522,10 +1528,6 @@ result = <boolean>_(testEqArray).isEqual(testEqOtherArray, testEqCustomizerFn);
result = <boolean>_.eq(testEqArray, testEqOtherArray, testEqCustomizerFn);
result = <boolean>_(testEqArray).eq(testEqOtherArray, testEqCustomizerFn);
result = <boolean>_.isObject({});
result = <boolean>_.isObject([1, 2, 3]);
result = <boolean>_.isObject(1);
class Stooge {
constructor(
public name: string,

29
lodash/lodash.d.ts vendored
View File

@@ -6415,6 +6415,24 @@ declare module _ {
isNumber(): boolean;
}
//_.isObject
interface LoDashStatic {
/**
* Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
* and new String(''))
* @param value The value to check.
* @return Returns true if value is an object, else false.
**/
isObject(value?: any): boolean;
}
interface LoDashWrapperBase<T, TWrapper> {
/**
* see _.isObject
*/
isObject(): boolean;
}
//_.isPlainObject
interface LoDashStatic {
/**
@@ -7215,17 +7233,6 @@ declare module _ {
thisArg?: any): boolean;
}
//_.isObject
interface LoDashStatic {
/**
* Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes,
* new Number(0), and new String(''))
* @param value The value to check.
* @return True if the value is an object, else false.
**/
isObject(value?: any): boolean;
}
//_.keys
interface LoDashStatic {
/**