lodash: added _.isSet

This commit is contained in:
Ilya Mochalov
2016-03-09 10:28:54 +05:00
parent 9f0f926a12
commit a6ff12718c
2 changed files with 57 additions and 0 deletions
+31
View File
@@ -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 {
{
+26
View File
@@ -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> {}