diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8d4b23169..13ac22469 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1186,6 +1186,12 @@ result = _(undefined).isNaN(); result = _.isNative(Array.prototype.push); result = _(Array.prototype.push).isNative(); +// _.isRegExp +result = _.isRegExp(any); +result = _(1).isRegExp(); +result = _([]).isRegExp(); +result = _({}).isRegExp(); + // _.isTypedArray result = _.isTypedArray([]); result = _([]).isTypedArray(); @@ -1436,8 +1442,6 @@ result = _.isPlainObject(new Stooge('moe', 40)); result = _.isPlainObject([1, 2, 3]); result = _.isPlainObject({ 'name': 'moe', 'age': 40 }); -result = _.isRegExp(/moe/); - result = _.isString('moe'); result = _.isUndefined(void 0); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 2bdf00691..ab1ef2a3e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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 { + /** + * 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 { /**