mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
lodash: added _.isWeakMap
This commit is contained in:
@@ -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 {
|
||||
{
|
||||
|
||||
Vendored
+26
@@ -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> {}
|
||||
|
||||
Reference in New Issue
Block a user