import { CharacterWhitespace } from './CharacterWhitespace.js'; /** * Removes the leading and trailing white space and line terminator * characters from a string. * * @template S The string to trim. * @returns The trimmed string. * @example trim(' Hello world ') // 'Hello world' */ type Trim = S extends `${CharacterWhitespace}${infer R}` ? Trim : S extends `${infer L}${CharacterWhitespace}` ? Trim : S; export type { Trim };