Merge pull request #5441 from chrootsu/lodash-isRegExp

lodash: changed _.isRegExp() method
This commit is contained in:
Masahiro Wakame
2015-08-21 22:50:29 +09:00
2 changed files with 23 additions and 12 deletions
+6 -2
View File
@@ -1186,6 +1186,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();
@@ -1436,8 +1442,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
@@ -6195,6 +6195,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 {
/**
@@ -7048,16 +7065,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 {
/**