Type guard that checks if a string has at least minLength characters.
The length is measured in UTF-16 code units (the same unit as
String.prototype.length), so characters outside the Basic Multilingual
Plane (e.g. emoji) count as 2.
Type Narrowing Behavior:
Narrows the input to MinLengthString<MinLength> while preserving the
original string type (e.g. literal types) via intersection.
The result participates in the length-constraint subtyping relation: for
example, a value narrowed to MinLengthString<3> is assignable to
MinLengthString<1> (= NonEmptyString).
Type Parameters
Sextendsstring
The input string type (literal types are preserved).
Type guard that checks if a string has at least
minLengthcharacters.The length is measured in UTF-16 code units (the same unit as
String.prototype.length), so characters outside the Basic Multilingual Plane (e.g. emoji) count as 2.Type Narrowing Behavior:
MinLengthString<MinLength>while preserving the original string type (e.g. literal types) via intersection.MinLengthString<3>is assignable toMinLengthString<1>(=NonEmptyString).