mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
(feature) Add _.isObjectLike
This commit is contained in:
@@ -6245,6 +6245,26 @@ module TestIsObject {
|
||||
}
|
||||
}
|
||||
|
||||
// _.isObjectLike
|
||||
module TestIsObjectLike {
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isObjectLike(any);
|
||||
result = _(1).isObjectLike();
|
||||
result = _<any>([]).isObjectLike();
|
||||
result = _({}).isObjectLike();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isObjectLike();
|
||||
result = _<any>([]).chain().isObjectLike();
|
||||
result = _({}).chain().isObjectLike();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isPlainObject
|
||||
module TestIsPlainObject {
|
||||
{
|
||||
|
||||
Vendored
+42
@@ -10087,6 +10087,48 @@ declare module _ {
|
||||
isObject(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isObjectLike
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
||||
* and has a `typeof` result of "object".
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isObjectLike({});
|
||||
* // => true
|
||||
*
|
||||
* _.isObjectLike([1, 2, 3]);
|
||||
* // => true
|
||||
*
|
||||
* _.isObjectLike(_.noop);
|
||||
* // => false
|
||||
*
|
||||
* _.isObjectLike(null);
|
||||
* // => false
|
||||
*/
|
||||
isObjectLike(value?: any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isObjectLike
|
||||
*/
|
||||
isObjectLike(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isObjectLike
|
||||
*/
|
||||
isObjectLike(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isPlainObject
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user