TS-UT

Overview

A TypeScript utility types library.

Quick Examples

import { Param } from "@inzero/ts-ut";
import { GetDeep } from "@inzero/ts-ut/dict"; // Or category-specific imports

type Handler = (foo: string, bar: number) => boolean;
type LastParam = Param<Handler, -1>; // number

type Config = { a: 1; b: { c: 4 } };
type Target = GetDeep<Config, "b.c">; // 4

Installation

npm install -D @inzero/ts-ut

Notes

  • The docs are automatically generated from the JSDoc comments in the source code.
  • Each utility has "Shape" and "Source" tabs so you can see the expected parameters, and how it's implemented.

On this page