[jquery] Add tests for type of a type guard in the not case.

Note that isPlainObject() fails the not case in the same manner that isEmptyObject() does. This might warrant changing it to return a boolean. However, unlike isEmptyObject(), isPlainObject() can be useful when the object is a plain object.
This commit is contained in:
Leonard Thieu
2017-07-18 09:22:02 -04:00
parent 226ef5f14c
commit ec2158f2d6

View File

@@ -622,6 +622,9 @@ function JQueryStatic() {
if ($.isArray(obj)) {
// $ExpectType any[]
obj;
} else {
// $ExpectType object
obj;
}
}
}
@@ -636,6 +639,9 @@ function JQueryStatic() {
if ($.isFunction(obj)) {
// $ExpectType Function
obj;
} else {
// $ExpectType object
obj;
}
}
}
@@ -645,6 +651,9 @@ function JQueryStatic() {
if ($.isNumeric(obj)) {
// $ExpectType (true & number) | (false & number)
obj;
} else {
// $ExpectType boolean
obj;
}
}
}
@@ -663,6 +672,9 @@ function JQueryStatic() {
if ($.isWindow(obj)) {
// $ExpectType Window
obj;
} else {
// $ExpectType object
obj;
}
}
}