npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ts-strict-utils

v1.0.0

Published

Utilities for TypeScript. Includes stricter built-ins, map that accepts objects as keys, etc...

Readme

🚀 Features

  • TypedObjKeyedMap - A typed Map data structure that accepts objects as keys, where keys are compared based on deep structural equality.
  • StrictOmit - An Utility type that enforces omitted keys to exist on the original type, with full IDE auto-completion support.
  • StrictExtract - An Utility type that enforces extracted keys to exist on the original type, with full IDE auto-completion support.
  • typedObjectEntries - A strongly typed version of Object.entries.
  • typedObjectFromEntries - A strongly typed version of Object.fromEntries.

📦 Installation

npm install ts-strict-utils

💻 Usage Examples

TypedObjKeyedMap

A typed Map data structure that accepts objects as keys, where keys are compared based on deep structural equality. This allows objects with different key ordering to be considered the same, and it also supports objects containing circular references. Internally, it uses serialize-javascript to handle objects containing Dates, RegExp, functions, etc...

import { TypedObjKeyedMap } from 'ts-strict-utils';

type ObjKeyType = {
  a: string
  b: number
  c: {
    d: string
  }
}

const key1 = { a: 'a', b: 1, c: { d: 'd' } }
const key2 = { a: 'different', b: 2, c: { d: 'random' } }
const key3 = { b: 1, a: 'a', c: { d: 'd' } }
// key3 is structurally the same as key1.
//  But they don't share the same reference.

// Outputs: false
console.log(Object.is(key1, key3))

const map = new TypedObjKeyedMap<ObjKeyType, string>(),

map.set(key1, 'value1')
map.set(key2, 'value2')
map.set(key3, 'value3')
// key3 overwrites key1's entry. Because they are structurally equal.

console.log(map.get(key1)) // Outputs: 'value3'
console.log(
  map.get(key2)
) // Outputs: 'value2'

StrictOmit

An Utility type that enforces omitted keys to exist on the original type, with full IDE auto-completion support.

import { StrictOmit } from 'ts-strict-utils'

type Original = 'strict' | 'utils' | 'type'

//   Doesn't throw even if 'stryct' is spelled incorrectly.
//      Also doesn't provide autocompletion.
type WithNormalOmit = Omit<Original, 'utils' | 'stryct'>

//   Throws: Type '"stryct"' does not satisfy the constraint 'strict' | 'utils' | 'type'.
//        Provides autocompletion.
type WithStrictOmit = StrictOmit<Original, 'utils' | 'stryct'>

StrictExtract

An Utility type that enforces extracted keys to exist on the original type, with full IDE auto-completion support.

import { StrictExtract } from 'ts-strict-utils'

type Original = 'strict' | 'utils' | 'type'

//  Doesn't throw even if 'stryct' is spelled incorrectly.
//  Also doesn't provide autocompletion.
type WithNormalExtract = Extract<Original, 'utils' | 'stryct'>

//  Throws: Type '"stryct"' does not satisfy the constraint 'strict' | 'utils' | 'type'.
//  Provides autocompletion.
type WithStrictExtract = StrictExtract<Original, 'utils' | 'stryct'>

👥 Community & Support

  • 💬 Have an idea? Suggest new features in GitHub Discussions.

  • 🚀 Support me or my projects through donations.

  • 💼 Need custom work or consultation? I am available for hire! Reach out via email.