mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
(feature) Add _.upperFirst and _.upperCase
This commit is contained in:
@@ -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, & pebbles').chain().upperCase();
|
||||
}
|
||||
}
|
||||
|
||||
// _.upperFirst
|
||||
module TestUpperFirst {
|
||||
{
|
||||
let result: string;
|
||||
|
||||
result = _.upperFirst('fred, barney, & pebbles');
|
||||
result = _('fred, barney, & pebbles').upperFirst();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _('fred, barney, & pebbles').chain().upperFirst();
|
||||
}
|
||||
}
|
||||
|
||||
// _.unescape
|
||||
module TestUnescape {
|
||||
{
|
||||
|
||||
Vendored
+77
-4
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user