import type {Whitespace} from './internal'; /** Remove spaces from the left side. */ type TrimLeft = V extends `${Whitespace}${infer R}` ? TrimLeft : V; /** Remove spaces from the right side. */ type TrimRight = V extends `${infer R}${Whitespace}` ? TrimRight : V; /** Remove leading and trailing spaces from a string. @example ``` import type {Trim} from 'type-fest'; Trim<' foo '> //=> 'foo' ``` @category String @category Template literal */ export type Trim = TrimLeft>;