Last 12 weeks · 21 commits
5 of 6 standards met
Closes #121 This adds the three connected Basic function types from the final issue specification: for a reusable asynchronous signature; for an erased asynchronous function constraint; for an erased sync-or-async function constraint. The definitions follow the names, defaults, and edge-case decision discussed in #121. They live alongside the existing class and constructor types in , with README entries and examples. Tests cover generic arguments and return values, defaults, , rejection of synchronous functions by , acceptance of synchronous and asynchronous functions by , and a parameter. Validation: Codex assisted with checking the type edge cases, naming, documentation, examples, and test coverage against the upstream discussion and repository conventions.
When has an index signature like , returns because it counts the index signature as a required key. This causes to pass through the type as-is even when no concrete keys are present. Using before checking for required keys ensures index signatures are excluded from the check. Before: After: The above correctly fails type checking. Fixes #821 PayPal: n6085530@gmail.com
Repository: sindresorhus/type-fest. Description: A collection of essential TypeScript types Stars: 17382, Forks: 730. Primary language: TypeScript. Languages: TypeScript (85.2%), JavaScript (14.8%). License: CC0-1.0. Topics: npm-package, types, typescript, typescript-definitions, utilities. Latest release: v5.8.0 (1mo ago). Open PRs: 47, open issues: 177. Last activity: 5d ago. Community health: 100%. Top contributors: sindresorhus, som-sm, Emiyaaaaa, skarab42, voxpelli, trevorade, kainiedziela, tommy-mitchell, privatenumber, taiyakihitotsu and others.