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