mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Merge pull request #8458 from chrootsu/lodash-isSet
lodash: added _.isSet
This commit is contained in:
@@ -7050,6 +7050,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
@@ -12132,6 +12132,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 {
|
||||
/**
|
||||
@@ -18460,4 +18485,5 @@ declare module "lodash" {
|
||||
}
|
||||
|
||||
// Backward compatibility with --target es5
|
||||
interface Set<T> {}
|
||||
interface Map<K, V> {}
|
||||
|
||||
Reference in New Issue
Block a user