mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-28 17:21:43 +00:00
Lodash: isObject: user-defined type guard
This commit is contained in:
Vendored
+1
-1
@@ -1984,7 +1984,7 @@ declare namespace _ {
|
||||
type LodashIsNil = (value: any) => value is null | undefined;
|
||||
type LodashIsNull = (value: any) => value is null;
|
||||
type LodashIsNumber = (value: any) => value is number;
|
||||
type LodashIsObject = (value: any) => boolean;
|
||||
type LodashIsObject = (value: any) => value is object;
|
||||
type LodashIsObjectLike = (value: any) => boolean;
|
||||
type LodashIsPlainObject = (value: any) => boolean;
|
||||
type LodashIsRegExp = (value: any) => value is RegExp;
|
||||
|
||||
@@ -4291,6 +4291,10 @@ fp.now(); // $ExpectType number
|
||||
_(42).isObject(); // $ExpectType boolean
|
||||
_.chain([]).isObject(); // $ExpectType LoDashExplicitWrapper<boolean>
|
||||
fp.isObject(anything); // $ExpectType boolean
|
||||
if (fp.isObject(anything)) {
|
||||
// $ExpectType object
|
||||
anything
|
||||
};
|
||||
}
|
||||
|
||||
// _.isObjectLike
|
||||
|
||||
Reference in New Issue
Block a user