11 lines
206 B
TypeScript
11 lines
206 B
TypeScript
![]() |
const reWhitespace = /\s/
|
||
|
|
||
|
export function trimmedEndIndex(string: string) {
|
||
|
let index = string.length
|
||
|
|
||
|
while (index-- && reWhitespace.test(string.charAt(index))) {
|
||
|
/* empty */
|
||
|
}
|
||
|
return index
|
||
|
}
|