Block a user
@t.behrendt/tst (0.1.8)
Published 2026-07-22 15:34:25 +02:00 by t.behrendt
Installation
@t.behrendt:registry=https://gitea.t000-n.de/api/packages/t.behrendt/npm/npm install @t.behrendt/tst@0.1.8"@t.behrendt/tst": "0.1.8"About this package
tst
A library for hyper-typing in TypeScript.
Branding
Branding allows you to create truly unique types based on primitive types. Brands prvents accidental mixing of types like assigning a ProductId to a UserId.
Usage
type Branded<T, B extends symbol> = T & { [brand]: B };
Example:
const userIdBrand = Symbol("UserId");
type UserId = Branded<string, typeof userIdBrand>;
const userId: UserId = "123";
userId.brand === userIdBrand; // true
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @types/bun | latest |
| oxfmt | 0.57.0 |
| oxlint | 1.72.0 |
| typescript | 7.0.2 |