awesome-repositories.com
Blog
MCP
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
mattpocock avatar

mattpocock/ts-reset

0
View on GitHub↗

Ts Reset

ts-reset is a TypeScript type enhancement library that overrides and augments the built-in type definitions for standard JavaScript APIs. Its core purpose is to replace unsafe any return types with stricter alternatives like unknown, forcing developers to explicitly validate data before using it. The library achieves this through global type augmentation and declaration merging, applying changes across the entire project without requiring per-file imports.

The library differentiates itself by targeting specific pain points in everyday TypeScript usage. It relaxes type constraints on array methods like includes and indexOf for readonly arrays, allowing membership checks and index lookups with values that don't match the array's element type. Similarly, it widens Map.has and Set.has to accept broader value types during existence checks. For array filtering, it injects Boolean as a type predicate, narrowing filtered results to exclude falsy values. On the safety side, it hardens browser storage API return types and changes JSON.parse and Response.json to return unknown instead of any, preventing unsafe access patterns.

The broader capability surface includes conditional type narrowing for standard APIs, type predicate injection into filter callbacks, and stricter type guarding for Array.isArray checks. These changes collectively enforce a more rigorous type safety posture for common JavaScript operations without requiring manual type annotations or wrapper functions. The library is distributed as a single package that can be added to any TypeScript project, applying its type improvements globally through declaration merging.

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI
www.totaltypescript.com/ts-reset
↗

Features

  • Type Safety Resets - Improves default TypeScript types for common JavaScript APIs to catch more errors and require explicit validation.
  • Type-Safe Local Storage - Hardens browser storage API return types to prevent unsafe data access patterns.
  • Global Type Augmentations - Overrides built-in TypeScript type definitions globally using declaration merging to change default behavior.
  • Conditional Types - Uses conditional types to widen or tighten type constraints on standard JavaScript APIs like Array and Map.
  • Unknown-First Return Types - Replaces any return types with unknown in methods like JSON.parse and Response.json to enforce type safety.
  • Widened Set Membership Checks - Widens Set.has type constraints to accept broader value types during membership checks.
  • Map Key Validation - Relaxes Map.has type constraints to accept broader value types during key existence checks.
  • Widened Key Existence Checks - Widens Map.has type constraints to accept broader value types during key existence checks.
  • Rigorous Type Set Operations - Widens Set.has type constraints to accept broader value types during membership checks.
  • Type Enhancement Libraries - A library that improves built-in TypeScript types for common JavaScript APIs, replacing unsafe any types with stricter alternatives.
  • Boolean Type Predicate Filters - Removes falsy values from an array type by using Boolean as a type predicate in the filter method.
  • Widened Includes on Const Arrays - Checks membership in readonly arrays without requiring the search value to match the array's element type.
  • Truthy Array Filters - Removes falsy values from an array by passing Boolean as the filter callback and narrowing the result type.
  • Strict Response.json Return Types - Narrows Response.json return type to unknown instead of any so you must validate the data before use.
  • Safe JSON Parsing - Converts JSON strings into unknown instead of any so you must check the type before accessing properties.
  • Readonly Array Method Wideners - Relaxes type checking on readonly array methods like includes and indexOf to accept broader value types.
  • Strict JSON.parse Return Types - Narrows JSON.parse return type to unknown instead of any so you must verify the result before using it.
  • Array.isArray - Checks whether a value is an array and narrows its type to unknown instead of any for precise type guarding.
  • Loosened Array Index Finders - Locates a value's position in a readonly array without requiring the value to match the array's element type.
  • Widened IndexOf on Const Arrays - Finds positions in readonly arrays without requiring the search value to match the array's element type.
  • Loosened Array Membership Checks - Checks if a value exists in a readonly array without requiring the value to match the array's element type.
  • Type Predicate Injections - Injects Boolean as a type predicate into filter callbacks to narrow array results to truthy values.
  • Array Type Guards - Verifies whether a value is an array and narrows its type to unknown instead of any for safer handling.
  • Safe Fetch Response Parsing - Converts fetch response bodies to unknown instead of any to encourage explicit result validation.
  • Storage API Type Hardening - Strictens the return types of browser storage APIs to prevent unsafe access patterns.
8,533 Stars·138 Forks·TypeScript·MIT·13 Aufrufe

Star-Verlauf

Star-Verlauf für mattpocock/ts-resetStar-Verlauf für mattpocock/ts-reset

Häufig gestellte Fragen

Was macht mattpocock/ts-reset?

ts-reset is a TypeScript type enhancement library that overrides and augments the built-in type definitions for standard JavaScript APIs. Its core purpose is to replace unsafe any return types with stricter alternatives like unknown, forcing developers to explicitly validate data before using it. The library achieves this through global type augmentation and declaration merging, applying changes across the entire project without requiring per-file imports.

Was sind die Hauptfunktionen von mattpocock/ts-reset?

Die Hauptfunktionen von mattpocock/ts-reset sind: Type Safety Resets, Type-Safe Local Storage, Global Type Augmentations, Conditional Types, Unknown-First Return Types, Widened Set Membership Checks, Map Key Validation, Widened Key Existence Checks.

Welche Open-Source-Alternativen gibt es zu mattpocock/ts-reset?

Open-Source-Alternativen zu mattpocock/ts-reset sind unter anderem: microsoft/typescript-handbook — This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental… sindresorhus/type-fest — type-fest is a library of reusable utility types for performing complex transformations and validations on objects,… google/schema-dts — Schema-dts is a type-safe library providing TypeScript interfaces for modeling structured data and interconnected… piotrwitek/utility-types — This is a TypeScript utility type library providing advanced type aliases and mapped types for complex object and… isar/hive — Hive is a lightweight NoSQL key-value database written in pure Dart for local data persistence. It functions as a… chrisbanes/tivi — Tivi is a cross-platform application for discovering and tracking television shows, built with Kotlin Multiplatform…

Open-Source-Alternativen zu Ts Reset

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Ts Reset.
  • sindresorhus/type-festAvatar von sindresorhus

    sindresorhus/type-fest

    17,233Auf GitHub ansehen↗

    type-fest is a library of reusable utility types for performing complex transformations and validations on objects, arrays, strings, and numeric ranges in TypeScript. It provides a collection of type definitions designed to handle advanced structural changes and constraints. The project distinguishes itself by offering specialized logic for string literal processing, such as casing transformations and pattern-based modifications, and type-level arithmetic for calculating numeric ranges and absolute values. It also includes utilities for enforcing deep immutability, ensuring union mutual exclu

    TypeScriptnpm-packagetypestypescript
    Auf GitHub ansehen↗17,233
  • microsoft/typescript-handbookAvatar von microsoft

    microsoft/TypeScript-Handbook

    4,855Auf GitHub ansehen↗

    This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental principles of the language, including its structural type system, static type analysis, and the process of transpiling typed source files into JavaScript. The material details how to model complex data and reusable type logic using generics, conditional types, and mapped types. It also explains the use of declaration files to provide type safety for external JavaScript libraries and the integration of type checking into existing JavaScript projects via JSDoc annotations. The

    JavaScriptdocumentationlearntypescript
    Auf GitHub ansehen↗4,855
  • google/schema-dtsAvatar von google

    google/schema-dts

    1,204Auf GitHub ansehen↗

    Schema-dts is a type-safe library providing TypeScript interfaces for modeling structured data and interconnected graph relationships. It serves as a framework for defining and enforcing strict property requirements for JSON-LD objects, ensuring that metadata generated for web applications and search engines adheres to established vocabulary standards. The project distinguishes itself by providing a comprehensive set of definitions for the Schema.org vocabulary, enabling developers to build complex, machine-readable data graphs with compile-time validation. It supports the composition of mult

    TypeScriptjson-ldknowledge-graphlinked-data
    Auf GitHub ansehen↗1,204
  • chrisbanes/tiviAvatar von chrisbanes

    chrisbanes/tivi

    6,732Auf GitHub ansehen↗

    Tivi is a cross-platform application for discovering and tracking television shows, built with Kotlin Multiplatform and Compose Multiplatform to share its user interface across Android, iOS, and desktop platforms. The app follows the Model-View-Intent (MVI) architecture pattern, where user actions are modelled as sealed class intents that reduce into a single immutable state object, ensuring predictable and unidirectional data flow managed through Kotlin coroutines and StateFlow. The application uses Hilt for compile-time dependency injection and SQLDelight for type-safe local data storage, c

    Kotlinandroid-applicationjetpack-composekotlin
    Auf GitHub ansehen↗6,732
Alle 20 Alternativen zu Ts Reset anzeigen→