mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: added _.isSet
This commit is contained in:
@@ -6932,6 +6932,37 @@ module TestIsSafeInteger {
|
||||
}
|
||||
}
|
||||
|
||||
// _.isSet
|
||||
module TestIsSet {
|
||||
{
|
||||
let value: number|Set<string>;
|
||||
|
||||
if (_.isSet<string>(value)) {
|
||||
let result: Set<string> = value;
|
||||
}
|
||||
else {
|
||||
let result: number = value;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isSet(any);
|
||||
result = _(1).isSet();
|
||||
result = _<any>([]).isSet();
|
||||
result = _({}).isSet();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isSet();
|
||||
result = _<any>([]).chain().isSet();
|
||||
result = _({}).chain().isSet();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isString
|
||||
module TestIsString {
|
||||
{
|
||||
|
||||
Vendored
+26
@@ -11958,6 +11958,31 @@ declare module _ {
|
||||
isSafeInteger(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isSet
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is classified as a Set object.
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @returns Returns true if value is correctly classified, else false.
|
||||
*/
|
||||
isSet<T>(value?: any): value is Set<T>;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.isSet
|
||||
*/
|
||||
isSet(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.isSet
|
||||
*/
|
||||
isSet(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isString
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -18286,4 +18311,5 @@ declare module "lodash" {
|
||||
}
|
||||
|
||||
// Backward compatibility with --target es5
|
||||
interface Set<T> {}
|
||||
interface Map<K, V> {}
|
||||
|
||||
Reference in New Issue
Block a user