ts-uf

Overview

@inzero/ts-uf is a collection of TypeScript utility functions.

Installation

npm install @inzero/ts-uf

Quick Examples

import { isString } from "@inzero/ts-uf";

function foo(value: string | string[]) {
	if (isString(value)) {
		value; // string
	} else {
		value; // string[]
	}
}

Strictness

This library aims to provide utilities that are not too-strict and not too-loose.

Before you continue

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 return type, and how it's implemented.

Next

On this page