main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
513 bytes
|
Rev | Line | |
---|
[d565449] | 1 | /** Used to match a single whitespace character. */
|
---|
| 2 | var reWhitespace = /\s/;
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
---|
| 6 | * character of `string`.
|
---|
| 7 | *
|
---|
| 8 | * @private
|
---|
| 9 | * @param {string} string The string to inspect.
|
---|
| 10 | * @returns {number} Returns the index of the last non-whitespace character.
|
---|
| 11 | */
|
---|
| 12 | function trimmedEndIndex(string) {
|
---|
| 13 | var index = string.length;
|
---|
| 14 |
|
---|
| 15 | while (index-- && reWhitespace.test(string.charAt(index))) {}
|
---|
| 16 | return index;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | export default trimmedEndIndex;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.