Sha256: 1d4127595cdf32eff6baa0eb1361902820309231c8796e81c61a9794a62ea23f
Contents?: true
Size: 464 Bytes
Versions: 33
Compression:
Stored size: 464 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 {Trim} from 'type-fest'; Trim<' foo '> //=> 'foo' ``` @category Template Literals */ export type Trim<V extends string> = TrimLeft<TrimRight<V>>;
Version data entries
33 entries across 33 versions & 1 rubygems