Files
NapCatQQ/.pnpm-store/v3/files/16/231dd6501f573f513b2b92508388b26d3b0cbee10ae9468187ce11be6d2c905b1992982976e95b02befc9d1d2434b2c494b907086ee0d91e241e37910feaa1
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

25 lines
464 B
Plaintext

/**
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>>;