From d4a0660d7174dfa67ff1c983fd0d4001220e96c3 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 20 Aug 2015 01:04:01 +0500 Subject: [PATCH] lodash: changed _.isRegExp() method --- lodash/lodash-tests.ts | 8 ++++++-- lodash/lodash.d.ts | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2cbec6853..62d17bbe0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1168,6 +1168,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(); @@ -1427,8 +1433,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 c088f5459..71c4a2ef0 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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 { + /** + * 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 { /**