Skip to content

peerigon/typescript-toolkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

165 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typescript-toolkit

🔧✨ Tiny helpers for TypeScript applications

Version on NPM Version on JSR Semantically released Monthly downloads on NPM License

Small, focused utilities you import one at a time — tree-shakeable ES modules with subpath exports.

Features

  • 🎯 High-quality module design
  • âš¡ Lightweight sub-package exports
  • 📦 Tree-shakeable ES modules

Installation

npm install @peerigon/typescript-toolkit --save

Also available on JSR.

Usage

Import only the utilities you need. Each one is exposed as its own subpath:

import { assert } from "@peerigon/typescript-toolkit/assert";

Utilities

Module Description Docs
assert Assert a value is not null or undefined, with TypeScript narrowing →
need Assert a value is not null or undefined and return it with a narrowed type →
dedupe Remove duplicate values from an array while preserving first-occurrence order →
enums Lightweight string-enum alternative for erasableSyntaxOnly TypeScript projects →
match Exhaustive pattern matching with compile-time case checks, similar to switch →
result Type-safe error handling with pending, success, and error states →
unwrap Extract values from Result or nullable types, with optional fallback support →

License

MIT

Sponsors

Peerigon

About

🔧✨ Tiny helpers for TypeScript applications

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.0%
  • Other 1.0%