From 72f1dfa7b255c97fa40101767f20691d5b46013c Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 3 Nov 2015 05:40:44 +0500 Subject: [PATCH] lodash: signatures of the method _.startsWith have been changed --- lodash/lodash-tests.ts | 23 ++++++++++++++++++----- lodash/lodash.d.ts | 22 ++++++++++++++++++++-- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f12ca23c42..f06464f0bd 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4614,13 +4614,26 @@ module TestStartCase { } // _.startsWith -result = _.startsWith('abc', 'a'); -result = _.startsWith('abc', 'a', 1); -result = _('abc').startsWith('a'); -result = _('abc').startsWith('a', 1); +module TestStartsWith { + { + let result: boolean; + + result = _.startsWith('abc', 'a'); + result = _.startsWith('abc', 'a', 1); + + result = _('abc').startsWith('a'); + result = _('abc').startsWith('a', 1); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('abc').chain().startsWith('a'); + result = _('abc').chain().startsWith('a', 1); + } +} // _.template - module TestTemplate { interface TemplateExecutor { (obj?: Object): string; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 141ad993cd..b07519b842 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10146,19 +10146,37 @@ declare module _ { interface LoDashStatic { /** * Checks if string starts with the given target string. + * * @param string The string to search. * @param target The string to search for. * @param position The position to search from. * @return Returns true if string starts with target, else false. */ - startsWith(string?: string, target?: string, position?: number): boolean; + startsWith( + string?: string, + target?: string, + position?: number + ): boolean; } interface LoDashImplicitWrapper { /** * @see _.startsWith */ - startsWith(target?: string, position?: number): boolean; + startsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; } //_.template