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

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
mattpocock avatar

mattpocock/ts-reset

0
View on GitHub↗
8,533 stars·138 forks·TypeScript·MIT·13 vueswww.totaltypescript.com/ts-reset↗

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.

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.

Historique des stars

Graphique de l'historique des stars pour mattpocock/ts-resetGraphique de l'historique des stars pour mattpocock/ts-reset

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Alternatives open source à Ts Reset

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Ts Reset.
  • sindresorhus/type-festAvatar de sindresorhus

    sindresorhus/type-fest

    17,233Voir sur GitHub↗

    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
    Voir sur GitHub↗17,233
  • microsoft/typescript-handbookAvatar de microsoft

    microsoft/TypeScript-Handbook

    4,855Voir sur GitHub↗

    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
    Voir sur GitHub↗4,855
  • google/schema-dtsAvatar de google

    google/schema-dts

    1,204Voir sur GitHub↗

    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
    Voir sur GitHub↗1,204
  • chrisbanes/tiviAvatar de chrisbanes

    chrisbanes/tivi

    6,732Voir sur GitHub↗

    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
    Voir sur GitHub↗6,732
Voir les 20 alternatives à Ts Reset→

Questions fréquentes

Que fait 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.

Quelles sont les fonctionnalités principales de mattpocock/ts-reset ?

Les fonctionnalités principales de mattpocock/ts-reset sont : 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.

Quelles sont les alternatives open-source à mattpocock/ts-reset ?

Les alternatives open-source à mattpocock/ts-reset incluent : 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…