Skip to content
Logo

T.always

A literal: exactly one fixed value, every time.

T.always("electronics");
T.always(42);
T.always({ status: "active" });

Holds any value at all — not capped to strings/numbers/booleans. Always fabricates to exactly that value. No .as(): a fixed value has nothing meaningful left to override.

For a fresh value of a kind this library has no primitive for (a Map, a URL, a class instance), use T.opaque instead — T.always(someMap) types correctly but hands back the same reference every call.

To draw one of several fixed values, see T.enum. To draw one of several schemas, see T.choice.