Sha256: 7ad042f7d744ccfbcf6398216203c7712f01359d6fd4348c8bd8df8164e98096
Contents?: true
Size: 485 Bytes
Versions: 33
Compression:
Stored size: 485 Bytes
Contents
/** Remove spaces from the left side. */ type TrimLeft<V extends string> = V extends ` ${infer R}` ? TrimLeft<R> : V; /** Remove spaces from the right side. */ type TrimRight<V extends string> = V extends `${infer R} ` ? TrimRight<R> : 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<V extends string> = TrimLeft<TrimRight<V>>;
Version data entries
33 entries across 33 versions & 1 rubygems