From 90053552388a8ab95078633479e4cc0e0ff9a1e2 Mon Sep 17 00:00:00 2001 From: DomiR Date: Fri, 15 Jan 2016 01:42:13 +0100 Subject: [PATCH] (feature) Add _.toLower and _.toUpper --- lodash/lodash-tests.ts | 32 ++++++++++++++++++ lodash/lodash.d.ts | 76 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 574739560..ab51b9e44 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -8516,6 +8516,38 @@ module TestTemplate { } } +// _.toLower +module TestToLower { + { + let result: string; + + result = _.toLower('fred, barney, & pebbles'); + result = _('fred, barney, & pebbles').toLower(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('fred, barney, & pebbles').chain().toLower(); + } +} + +// _.toUpper +module TestToUpper { + { + let result: string; + + result = _.toUpper('fred, barney, & pebbles'); + result = _('fred, barney, & pebbles').toUpper(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('fred, barney, & pebbles').chain().toUpper(); + } +} + // _.trim module TestTrim { { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index e3dfd5235..2f98201dc 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -13473,6 +13473,82 @@ declare module _ { template(options?: TemplateOptions): LoDashExplicitObjectWrapper; } + //_.toLower + interface LoDashStatic { + /** + * Converts `string`, as a whole, to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.toLower('--Foo-Bar'); + * // => '--foo-bar' + * + * _.toLower('fooBar'); + * // => 'foobar' + * + * _.toLower('__FOO_BAR__'); + * // => '__foo_bar__' + */ + toLower(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLower + */ + toLower(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLower + */ + toLower(): LoDashExplicitWrapper; + } + + //_.toUpper + interface LoDashStatic { + /** + * Converts `string`, as a whole, to upper case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the upper cased string. + * @example + * + * _.toUpper('--foo-bar'); + * // => '--FOO-BAR' + * + * _.toUpper('fooBar'); + * // => 'FOOBAR' + * + * _.toUpper('__foo_bar__'); + * // => '__FOO_BAR__' + */ + toUpper(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): LoDashExplicitWrapper; + } + //_.trim interface LoDashStatic { /**