(feature) Add _.upperFirst and _.upperCase

This commit is contained in:
DomiR
2016-01-23 14:43:48 +01:00
parent dcf0aac8b2
commit 3276cdc914
2 changed files with 109 additions and 4 deletions
+32
View File
@@ -8608,6 +8608,38 @@ module Testtruncate {
}
}
// _.upperCase
module TestUpperCase {
{
let result: string;
result = _.upperCase('fred, barney, & pebbles');
result = _('fred, barney, & pebbles').upperCase();
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('fred, barney, &amp; pebbles').chain().upperCase();
}
}
// _.upperFirst
module TestUpperFirst {
{
let result: string;
result = _.upperFirst('fred, barney, &amp; pebbles');
result = _('fred, barney, &amp; pebbles').upperFirst();
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('fred, barney, &amp; pebbles').chain().upperFirst();
}
}
// _.unescape
module TestUnescape {
{
+77 -4
View File
@@ -114,12 +114,12 @@ added 13 object methods:
- [ ] _.unset
added 8 string methods:
- [ ] _.lowerCase
- [ ] _.lowerFirst
- [x] _.lowerCase
- [x] _.lowerFirst
- [ ] _.replace
- [ ] _.split
- [ ] _.upperCase
- [ ] _.upperFirst
- [x] _.upperCase
- [x] _.upperFirst
- [ ] _.toLower
- [ ] _.toUpper
@@ -13599,6 +13599,79 @@ declare module _ {
truncate(options?: TruncateOptions|number): LoDashExplicitWrapper<string>;
}
//_.upperCase
interface LoDashStatic {
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
upperCase(string?: string): string;
}
interface LoDashImplicitWrapper<T> {
/**
* @see _.upperCase
*/
upperCase(): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.upperCase
*/
upperCase(): LoDashExplicitWrapper<string>;
}
//_.upperFirst
interface LoDashStatic {
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
upperFirst(string?: string): string;
}
interface LoDashImplicitWrapper<T> {
/**
* @see _.upperFirst
*/
upperFirst(): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.upperFirst
*/
upperFirst(): LoDashExplicitWrapper<string>;
}
//_.unescape
interface LoDashStatic {
/**