API Reference / @evolu/common / Type / TrimString

Variable: TrimString

const TrimString: TransformType<Type<"String", string, string, StringError, string, StringError>, BrandType<Type<"String", string, string, StringError, string, StringError>, "Trimmed", never, StringError>, never>;

Defined in: packages/common/src/Type.ts:1927

Trims leading and trailing whitespace from a string.

Example

expect(TrimString.from("a ")).toEqual(ok("a"));
expect(TrimString.fromParent("a ").value).toEqual("a");

Was this page helpful?