10 lines
232 B
TypeScript
Raw Normal View History

2024-11-05 10:14:41 +08:00
import { trimmedEndIndex } from './_trimmedEndIndex'
const reTrimStart = /^\s+/
export function baseTrim(string: string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string
}