lodash: added _.isWeakMap

This commit is contained in:
Ilya Mochalov
2016-03-12 20:46:28 +05:00
parent d22516f9f0
commit 36bfd4fd3b
2 changed files with 57 additions and 0 deletions
+31
View File
@@ -7170,6 +7170,37 @@ module TestIsUndefined {
}
}
// _.isWeakMap
module TestIsWeakMap {
{
let value: number|WeakMap<string, number>;
if (_.isWeakMap<string, number>(value)) {
let result: WeakMap<string, number> = value;
}
else {
let result: number = value;
}
}
{
let result: boolean;
result = _.isWeakMap(any);
result = _(1).isWeakMap();
result = _<any>([]).isWeakMap();
result = _({}).isWeakMap();
}
{
let result: _.LoDashExplicitWrapper<boolean>;
result = _(1).chain().isWeakMap();
result = _<any>([]).chain().isWeakMap();
result = _({}).chain().isWeakMap();
}
}
// _.lt
module TestLt {
{
+26
View File
@@ -12267,6 +12267,31 @@ declare module _ {
isUndefined(): LoDashExplicitWrapper<boolean>;
}
//_.isWeakMap
interface LoDashStatic {
/**
* Checks if value is classified as a WeakMap object.
*
* @param value The value to check.
* @returns Returns true if value is correctly classified, else false.
*/
isWeakMap<K, V>(value?: any): value is WeakMap<K, V>;
}
interface LoDashImplicitWrapperBase<T, TWrapper> {
/**
* @see _.isSet
*/
isWeakMap(): boolean;
}
interface LoDashExplicitWrapperBase<T, TWrapper> {
/**
* @see _.isSet
*/
isWeakMap(): LoDashExplicitWrapper<boolean>;
}
//_.lt
interface LoDashStatic {
/**
@@ -18487,3 +18512,4 @@ declare module "lodash" {
// Backward compatibility with --target es5
interface Set<T> {}
interface Map<K, V> {}
interface WeakMap<K, V> {}