mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-29 11:12:23 +08:00
(feature) Add _.isNil
This commit is contained in:
@@ -6151,6 +6151,27 @@ module TestIsNative {
|
||||
}
|
||||
}
|
||||
|
||||
// _.isNil
|
||||
module TestIsNil {
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isNil(any);
|
||||
|
||||
result = _(1).isNil();
|
||||
result = _<any>([]).isNil();
|
||||
result = _({}).isNil();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isNil();
|
||||
result = _<any>([]).chain().isNil();
|
||||
result = _({}).chain().isNil();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isNull
|
||||
module TestIsNull {
|
||||
{
|
||||
|
||||
Vendored
+38
@@ -9971,6 +9971,44 @@ declare module _ {
|
||||
isNative(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isNil
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if `value` is `null` or `undefined`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isNil(null);
|
||||
* // => true
|
||||
*
|
||||
* _.isNil(void 0);
|
||||
* // => true
|
||||
*
|
||||
* _.isNil(NaN);
|
||||
* // => false
|
||||
*/
|
||||
isNil(value?: any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isNil
|
||||
*/
|
||||
isNil(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isNil
|
||||
*/
|
||||
isNil(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isNull
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user