From 95ef7354addd43c725077a739a2ae0c8a8dae4b0 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 24 Dec 2015 09:24:02 +0500 Subject: [PATCH] lodash: signatures of _.isString have been changed --- lodash/lodash-tests.ts | 39 ++++++++++++++++++++++++++++----------- lodash/lodash.d.ts | 10 +++++++++- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3f7a26556..b9a1a3571 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6111,17 +6111,34 @@ module TestIsRegExp { } // _.isString -result = _.isString(any); -result = _(1).isString(); -result = _([]).isString(); -result = _({}).isString(); -{ - let value: string|number = "foo"; - if (_.isString(value)) { - let result: string = value; - } else { - let result: number = value * 42; - } +module TestIsString { + { + let value: number|string; + + if (_.isString(value)) { + let result: string = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isString(any); + result = _(1).isString(); + result = _([]).isString(); + result = _({}).isString(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isString(); + result = _([]).chain().isString(); + result = _({}).chain().isString(); + } } // _.isTypedArray diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 584500c10..21afab387 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10165,9 +10165,10 @@ declare module _ { 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): value is string; } @@ -10178,6 +10179,13 @@ declare module _ { isString(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isString + */ + isString(): LoDashExplicitWrapper; + } + //_.isTypedArray interface LoDashStatic { /**