mirror of
https://github.com/sindresorhus/type-fest.git
synced 2025-12-08 19:25:05 +00:00
13 lines
381 B
TypeScript
13 lines
381 B
TypeScript
import {expectType} from 'tsd';
|
|
import type {Trim} from '../index';
|
|
|
|
declare function trim<S extends string>(value: S): Trim<S>;
|
|
|
|
expectType<'foo'>(trim(' foo'));
|
|
expectType<'bar'>(trim('bar '));
|
|
expectType<'baz'>(trim(' baz '));
|
|
expectType<'waldo'>(trim(' waldo '));
|
|
expectType<'fr ed'>(trim(' fr ed '));
|
|
expectType<'foo'>(trim(' foo\n'));
|
|
expectType<'foo'>(trim(' foo\n\t '));
|