lodash: changed _.isRegExp() method

This commit is contained in:
Ilya Mochalov
2015-08-20 01:04:01 +05:00
parent bb45306d0f
commit d4a0660d71
2 changed files with 23 additions and 12 deletions
+6 -2
View File
@@ -1168,6 +1168,12 @@ result = <boolean>_(undefined).isNaN();
result = <boolean>_.isNative(Array.prototype.push);
result = <boolean>_(Array.prototype.push).isNative();
// _.isRegExp
result = <boolean>_.isRegExp(any);
result = <boolean>_(1).isRegExp();
result = <boolean>_<any>([]).isRegExp();
result = <boolean>_({}).isRegExp();
// _.isTypedArray
result = <boolean>_.isTypedArray([]);
result = <boolean>_([]).isTypedArray();
@@ -1427,8 +1433,6 @@ result = <boolean>_.isPlainObject(new Stooge('moe', 40));
result = <boolean>_.isPlainObject([1, 2, 3]);
result = <boolean>_.isPlainObject({ 'name': 'moe', 'age': 40 });
result = <boolean>_.isRegExp(/moe/);
result = <boolean>_.isString('moe');
result = <boolean>_.isUndefined(void 0);
+17 -10
View File
@@ -6160,6 +6160,23 @@ declare module _ {
isNative(): boolean;
}
//_.isRegExp
interface LoDashStatic {
/**
* 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): boolean;
}
interface LoDashWrapperBase<T, TWrapper> {
/**
* see _.isRegExp
*/
isRegExp(): boolean;
}
//_.isTypedArray
interface LoDashStatic {
/**
@@ -7036,16 +7053,6 @@ declare module _ {
isPlainObject(value?: any): boolean;
}
//_.isRegExp
interface LoDashStatic {
/**
* Checks if value is a regular expression.
* @param value The value to check.
* @return True if the value is a regular expression, else false.
**/
isRegExp(value?: any): boolean;
}
//_.isString
interface LoDashStatic {
/**