From dcf0aac8b272dda73024d832988fc85a1a91f91d Mon Sep 17 00:00:00 2001 From: DomiR Date: Thu, 14 Jan 2016 18:06:29 +0100 Subject: [PATCH] (feature) Add _.lowerCase and _.lowerFirst --- lodash/lodash-tests.ts | 32 ++++++++++++++++++ lodash/lodash.d.ts | 73 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index bea9ee14a..a20319e2d 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -8289,6 +8289,38 @@ module TestKebabCase { } } +// _.lowerCase +module TestLowerCase { + { + let result: string; + + result = _.lowerCase('Foo Bar'); + result = _('Foo Bar').lowerCase(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('Foo Bar').chain().lowerCase(); + } +} + +// _.lowerFirst +module TestLowerFirst { + { + let result: string; + + result = _.lowerFirst('Foo Bar'); + result = _('Foo Bar').lowerFirst(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('Foo Bar').chain().lowerFirst(); + } +} + // _.pad module TestPad { { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 5cadfc55f..ee569ab6e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -13078,6 +13078,79 @@ declare module _ { kebabCase(): LoDashExplicitWrapper; } + //_.lowerCase + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + lowerCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): LoDashExplicitWrapper; + } + + //_.lowerFirst + interface LoDashStatic { + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + lowerFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): LoDashExplicitWrapper; + } + //_.pad interface LoDashStatic { /**