skip to content
vvhybe

case 142024

toothscript

TypeScript utility types that stay out of your global namespace.

filed
my own
cold casenov 2024
role
author
period
2024
status
cold: archived, kept for the record

the brief

sheet 2 of 5

TypeScript keeps new utility types out of the language on purpose, and libraries that fill the gap often declare theirs globally, in your namespace.

Eighteen small types, each imported by name, nothing global.

the identity

sheet 3 of 5
toothscript's mark: a white tooth on TypeScript blue
the markMine: a tooth, on TypeScript's own blue.

A pun you can see: toothscript sounds like TypeScript, so it wears TypeScript's blue and wordmark, with a tooth beside them.

the colours

  • TypeScript blue#358EF1
  • enamel#E8ECEF

the build

sheet 4 of 5

what's in it

Property helpers like StrictOmit, NullableKeys and PickByType; recursive ones like DeepPartial and DeepReadonly; negations like ExcludeKeys; and Nominal, for branded types that keep a UserId from passing as a plain number.

a year after handyscript

In 2023, handyscript added methods to Array and Math. A year later, toothscript's first rule was no global pollution.

made with typescript

the verdict

sheet 5 of 5
  1. Nov 2024On npm, built with nothing but tsc, and opened to anyone with a type to add.
  2. sinceArchived. It stayed an idea, and I let it go.
toothscript: its cover
case 14, toothscript
print 1 / 1