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

@lucasbernardosn/ts-utils

v0.6.0

Published

Funções e helpers de tipo em TypeScript puro, sem React e sem dependências.

Readme

@lucasbernardosn/ts-utils

Funções e helpers de tipo em TypeScript puro, sem React e sem dependências. Serve a qualquer projeto TypeScript e é a base do @lucasbernardosn/react-ui e do @lucasbernardosn/react-table.

Substitui o @lucasbernardosn/utils: a troca é só do nome no import.

Instalação

pnpm add @lucasbernardosn/ts-utils

Tudo sai da raiz do pacote:

import { getInitials, isDeepEqual, type DeepPartial } from '@lucasbernardosn/ts-utils';

Funções

| Função | Para quê | | ------ | -------- | | composeEventHandlers | Junta vários handlers num só, chamados em sequência com os mesmos argumentos; os undefined são ignorados | | createSplitProps | Separa um objeto de props em dois pela lista de chaves, que precisa cobrir todas as chaves do tipo pedido | | getHighlightChunks | Divide um texto em trechos que casam ou não com a busca (sem acento nem caixa), no formato { text, match }, para destacar o que casou | | getInitials | As iniciais de um nome, em maiúsculas: a do primeiro e a do último nome | | isDeepEqual | Igualdade estrutural, inclusive de Map, Set, Date, RegExp e arrays tipados | | isNotNullish | Guard que tira null e undefined do tipo, para usar no filter | | mergeBooleansAnd, mergeBooleansOr | Combinam booleanos com E e OU, ignorando os null e undefined | | toPascalCase | Converte texto para PascalCase, separando em -, _ e espaços | | sleep | Promise que resolve depois de um tempo, opcionalmente com um valor (para testes e protótipos) |

Tipos

| Tipo | Para quê | | ---- | -------- | | DeepPartial, DeepReadonly | Partial e Readonly em todos os níveis | | DeepKeys, DeepKeysFlat, DeepValue | Os caminhos de um objeto ('a.b.c') e o tipo do valor em cada um | | KeysOfType, PickByValue, OmitByValue | Chaves e recortes de um objeto pelo tipo do valor | | MergeOverride | Junta dois tipos, com as chaves do segundo substituindo as do primeiro | | Optional, RequiredExcept | Torna opcionais só as chaves pedidas, ou obrigatórias todas menos elas | | Recompose | Achata uma interseção num objeto só, para o editor mostrar o tipo final | | ValueOf, ArrayElement, NonEmptyArray | O tipo dos valores de um objeto, o elemento de um array e um array com ao menos um item | | Nullish, EnsureString, PascalCase | null ou undefined, o tipo que só aceita string e o PascalCase de um literal | | SerializableValue, StrictEmptyObject | Um valor que sobrevive ao JSON.stringify e o objeto sem chaves | | AnyType, UnknownType e variantes | Os any e unknown nomeados (AnyObject, UnknownFunction…), para o uso ser explícito |

O JSDoc de cada função e tipo, no editor, traz os detalhes e os exemplos.

Licença

MIT.