mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
lodash: signatures of _.isRegExp have been changed
This commit is contained in:
+28
-12
@@ -5635,18 +5635,34 @@ result = <boolean>_<any>([]).isPlainObject();
|
||||
result = <boolean>_({}).isPlainObject();
|
||||
|
||||
// _.isRegExp
|
||||
result = <boolean>_.isRegExp(any);
|
||||
result = <boolean>_(1).isRegExp();
|
||||
result = <boolean>_<any>([]).isRegExp();
|
||||
result = <boolean>_({}).isRegExp();
|
||||
{
|
||||
let value: RegExp|string = /^foo$/g;
|
||||
if (_.isRegExp(value)) {
|
||||
let regex: RegExp = value;
|
||||
let index: number = value.exec("foo").index;
|
||||
} else {
|
||||
let result: string = value;
|
||||
}
|
||||
module TestIsRegExp {
|
||||
{
|
||||
let value: number|RegExp;
|
||||
|
||||
if (_.isRegExp(value)) {
|
||||
let result: RegExp = value;
|
||||
}
|
||||
else {
|
||||
let result: number = value;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isRegExp(any);
|
||||
result = _(1).isRegExp();
|
||||
result = _<any>([]).isRegExp();
|
||||
result = _({}).isRegExp();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isRegExp();
|
||||
result = _<any>([]).chain().isRegExp();
|
||||
result = _({}).chain().isRegExp();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isString
|
||||
|
||||
Vendored
+8
@@ -9605,6 +9605,7 @@ declare module _ {
|
||||
/**
|
||||
* Checks if value is classified as a RegExp object.
|
||||
* @param value The value to check.
|
||||
*
|
||||
* @return Returns true if value is correctly classified, else false.
|
||||
*/
|
||||
isRegExp(value?: any): value is RegExp;
|
||||
@@ -9617,6 +9618,13 @@ declare module _ {
|
||||
isRegExp(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isRegExp
|
||||
*/
|
||||
isRegExp(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isString
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user