Skip to content

typek-org/typek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typek

Typek is a collection of useful, runtime-agnostic functions and types, serving as something of a standard library for TypeScript.

We have assertions and type assertions for unit testing, methods for transformations of iterables, and even ways of mapping entire objects in a type-safe manner.

examples

Array.from(unique("Hello world!")).join("") // Helo wrd!

const company = {
  ceo: { name: "Joe", surname: "Doe" },
  dev: { name: "Peter", surname: "Meter" },
};
ObjectEntries
  .from(company)
  .deepTransform(isPerson, ({name, surname}) => `${name} ${surname}`)
  .collect()
// { ceo: "Joe Doe", dev: "Peter Meter" }

assertTypeEquals<string | 42, string | 42>(); // ok!
assertTypeEquals<any, string | 42>(); // fail!

const { isDate, isResponse } = prototypeGuard({ Date, Response });

roadmap

Releases

No releases published

Packages

No packages published