(feature) Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd

This commit is contained in:
DomiR
2016-01-13 19:07:06 +01:00
parent 515bcddd07
commit 63157c261e
2 changed files with 31 additions and 32 deletions

View File

@@ -9203,46 +9203,45 @@ module TestTrim {
}
}
// _.trimLeft
module TestTrimLeft {
// _.trimStart
module TestTrimStart {
{
let result: string;
result = _.trimLeft();
result = _.trimLeft(' abc ');
result = _.trimLeft('-_-abc-_-', '_-');
result = _.trimStart();
result = _.trimStart(' abc ');
result = _.trimStart('-_-abc-_-', '_-');
result = _('-_-abc-_-').trimLeft();
result = _('-_-abc-_-').trimLeft('_-');
result = _('-_-abc-_-').trimStart();
result = _('-_-abc-_-').trimStart('_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('-_-abc-_-').chain().trimLeft();
result = _('-_-abc-_-').chain().trimLeft('_-');
result = _('-_-abc-_-').chain().trimStart();
result = _('-_-abc-_-').chain().trimStart('_-');
}
}
// _.trimRight
module TestTrimRight {
// _.trimEnd
module TestTrimEnd {
{
let result: string;
result = _.trimRight();
result = _.trimRight(' abc ');
result = _.trimRight('-_-abc-_-', '_-');
result = _.trimEnd();
result = _.trimEnd(' abc ');
result = _.trimEnd('-_-abc-_-', '_-');
result = _('-_-abc-_-').trimRight();
result = _('-_-abc-_-').trimRight('_-');
result = _('-_-abc-_-').trimEnd();
result = _('-_-abc-_-').trimEnd('_-');
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('-_-abc-_-').chain().trimRight();
result = _('-_-abc-_-').chain().trimRight('_-');
result = _('-_-abc-_-').chain().trimEnd();
result = _('-_-abc-_-').chain().trimEnd('_-');
}
}

26
lodash/lodash.d.ts vendored
View File

@@ -25,7 +25,7 @@ TODO:
- [x] Renamed _.rest to _.tail
- [x] Renamed _.restParam to _.rest
- [x] Renamed _.sortByOrder to _.orderBy
- [ ] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd
- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd
- [ ] Renamed _.trunc to _.truncate
- [ ] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf
@@ -14116,7 +14116,7 @@ declare module _ {
trim(chars?: string): LoDashExplicitWrapper<string>;
}
//_.trimLeft
//_.trimStart
interface LoDashStatic {
/**
* Removes leading whitespace or specified characters from string.
@@ -14125,7 +14125,7 @@ declare module _ {
* @param chars The characters to trim.
* @return Returns the trimmed string.
*/
trimLeft(
trimStart(
string?: string,
chars?: string
): string;
@@ -14133,19 +14133,19 @@ declare module _ {
interface LoDashImplicitWrapper<T> {
/**
* @see _.trimLeft
* @see _.trimStart
*/
trimLeft(chars?: string): string;
trimStart(chars?: string): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.trimLeft
* @see _.trimStart
*/
trimLeft(chars?: string): LoDashExplicitWrapper<string>;
trimStart(chars?: string): LoDashExplicitWrapper<string>;
}
//_.trimRight
//_.trimEnd
interface LoDashStatic {
/**
* Removes trailing whitespace or specified characters from string.
@@ -14154,7 +14154,7 @@ declare module _ {
* @param chars The characters to trim.
* @return Returns the trimmed string.
*/
trimRight(
trimEnd(
string?: string,
chars?: string
): string;
@@ -14162,16 +14162,16 @@ declare module _ {
interface LoDashImplicitWrapper<T> {
/**
* @see _.trimRight
* @see _.trimEnd
*/
trimRight(chars?: string): string;
trimEnd(chars?: string): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.trimRight
* @see _.trimEnd
*/
trimRight(chars?: string): LoDashExplicitWrapper<string>;
trimEnd(chars?: string): LoDashExplicitWrapper<string>;
}
//_.trunc