[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › wellFormed

```ts
const wellFormed: BrandFactory<"WellFormed", string, WellFormedError>;
```

Defined in: [packages/common/src/Type.ts:7629](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L7629)

String [Brand](https://evolu.dev/docs/api-reference/common/Brand/interfaces/Brand) for well-formed Unicode text without lone surrogates.

A JavaScript string is a sequence of UTF-16 code units, so it can contain a
high surrogate without the low surrogate that completes it, or the reverse,
for example after slicing an emoji in half. Such text has no UTF-8 encoding:
`TextEncoder` and many storage and network APIs replace each lone surrogate
with U+FFFD, so the text that arrives differs from the text that was sent.
Validation leaves the text unchanged.

### Example

```ts
import {
  assertErr,
  assertOk,
  maxLength,
  String,
  wellFormed,
} from "@evolu/common";

const Message = wellFormed(maxLength(100)(String));

assertOk(Message.fromUnknown("Hi 😀"), "Hi 😀");
assertErr(Message.fromUnknown("Hi 😀".slice(0, 4)));
```