mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-22 11:40:10 +08:00
lodash: added _.isMap
This commit is contained in:
@@ -6620,6 +6620,37 @@ module TestIsLength {
|
||||
}
|
||||
}
|
||||
|
||||
// _.isMap
|
||||
module TestIsMap {
|
||||
{
|
||||
let value: number|Map<string, number>;
|
||||
|
||||
if (_.isMap<string, number>(value)) {
|
||||
let result: Map<string, number> = value;
|
||||
}
|
||||
else {
|
||||
let result: number = value;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isMap(any);
|
||||
result = _(1).isMap();
|
||||
result = _<any>([]).isMap();
|
||||
result = _({}).isMap();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isMap();
|
||||
result = _<any>([]).chain().isMap();
|
||||
result = _({}).chain().isMap();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isMatch
|
||||
module TestIsMatch {
|
||||
let testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean;
|
||||
|
||||
Vendored
+25
@@ -11516,6 +11516,31 @@ declare module _ {
|
||||
isLength(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isMap
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is classified as a Map object.
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @returns Returns true if value is correctly classified, else false.
|
||||
*/
|
||||
isMap<K, V>(value?: any): value is Map<K, V>;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.isMap
|
||||
*/
|
||||
isMap(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.isMap
|
||||
*/
|
||||
isMap(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isMatch
|
||||
interface isMatchCustomizer {
|
||||
(value: any, other: any, indexOrKey?: number|string): boolean;
|
||||
|
||||
Reference in New Issue
Block a user