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

@jeftelabs/types

v1.0.0

Published

A collection of types-only helpers used across all the ArapucaJS, Teko, VineJS, and T8ngs packages

Readme

@jeftelabs/types

Helpers de tipos TypeScript para aplicações e bibliotecas do ecossistema JefteLabs.

O pacote reúne tipos reutilizáveis para manipular estruturas, construtores, imports lazy e identificadores de rota. Os helpers são resolvidos pelo TypeScript durante a compilação; não formam uma API de funções de runtime.

Instalação

npm install @jeftelabs/types

Uso

Importe os tipos diretamente do entry point do pacote:

import type { DeepPartial, InferRouteParams, Opaque } from '@jeftelabs/types'

type RouteParams = InferRouteParams<'/users/:id/:tab?'>
// { id: string; tab?: string }

type UserId = Opaque<string, 'user-id'>

type ConfigPatch = DeepPartial<{
  http: { enabled: boolean; port: number }
}>

Helpers disponíveis

Estruturas e propriedades

  • Prettify<T> normaliza visualmente um tipo mapeando suas propriedades.
  • Primitive reúne null, undefined, string, number, boolean, symbol e bigint.
  • OneOrMore<T> aceita T ou T[].
  • DeepPartial<T> torna propriedades aninhadas opcionais recursivamente para tipos de objeto.
  • AreAllOptional<T> verifica se as propriedades de topo aceitam undefined/são opcionais conforme a implementação.
  • ExtractUndefined<T> e ExtractDefined<T> selecionam chaves pelo pertencimento ou não a undefined.
  • ExtractFunctions<T, IgnoreList> seleciona propriedades que são funções e permite excluir chaves.
  • AsyncOrSync<T> aceita T ou PromiseLike<T>.

Classes e imports

  • Constructor<T, Arguments> representa um construtor concreto.
  • AbstractConstructor<T, Arguments> representa um construtor abstrato.
  • NormalizeConstructor<T> adapta uma assinatura de construtor para o padrão requerido por mixins TypeScript.
  • LazyImport<DefaultExport> representa função que resolve módulo com export default.
  • UnWrapLazyImport<Fn> extrai o tipo do default export da função lazy.

Tipos opacos

  • Opaque<T, K> adiciona uma marca nominal usando um unique symbol interno para distinguir valores estruturalmente iguais.
  • UnwrapOpaque<T> extrai o tipo subjacente de um Opaque.

Parâmetros de rota

  • InferRouteParams<Identifier> infere parâmetros :name, opcionais :name?, parâmetros com extensão como :file.json e wildcard * do padrão reconhecido pelo tipo.
  • Os tipos intermediários Param, ParamSegment, OptionalParam, OptionalParamSegment, WildcardParam e WildcardParamSegment também são exportados por src/route.ts.

Os detalhes de inferência e limites estão na referência da API; exemplos de uso estão nos guias.

Documentação

A documentação completa inclui guias, referências, planejamento, testes e benchmarks. As regras para agentes, incluindo a obrigação de documentar toda mudança, estão em AGENTS.md.

Desenvolvimento

npm install
npm run quick:test
npm run lint
npm run typecheck
npm run build

O guia de desenvolvimento descreve os scripts e o fluxo de contribuição. npm test inclui lint e cobertura; npm run format escreve as alterações de formatação.

Licença

MIT. Consulte LICENSE.