From 3bb67023949e0a303efaaeca7e59357cf14782a5 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 22 Aug 2015 14:47:40 +0500 Subject: [PATCH] lodash: changed _.isString() 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 00ca144fd2..f81217255d 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1242,6 +1242,12 @@ result = _(1).isRegExp(); result = _([]).isRegExp(); result = _({}).isRegExp(); +// _.isString +result = _.isString(any); +result = _(1).isString(); +result = _([]).isString(); +result = _({}).isString(); + // _.isTypedArray result = _.isTypedArray([]); result = _([]).isTypedArray(); @@ -1492,8 +1498,6 @@ result = _.isPlainObject(new Stooge('moe', 40)); result = _.isPlainObject([1, 2, 3]); result = _.isPlainObject({ 'name': 'moe', 'age': 40 }); -result = _.isString('moe'); - result = _.keys({ 'one': 1, 'two': 2, 'three': 3 }); result = _({ 'one': 1, 'two': 2, 'three': 3 }).keys().value(); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 77daeca2a1..b1082a4596 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6294,6 +6294,23 @@ declare module _ { isRegExp(): boolean; } + //_.isString + interface LoDashStatic { + /** + * Checks if value is classified as a String primitive or object. + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + **/ + isString(value?: any): boolean; + } + + interface LoDashWrapperBase { + /** + * see _.isString + */ + isString(): boolean; + } + //_.isTypedArray interface LoDashStatic { /** @@ -7143,16 +7160,6 @@ declare module _ { isPlainObject(value?: any): boolean; } - //_.isString - interface LoDashStatic { - /** - * Checks if value is a string. - * @param value The value to check. - * @return True if the value is a string, else false. - **/ - isString(value?: any): boolean; - } - //_.keys interface LoDashStatic { /**