tsentials/eq

Compare TypeScript values with composable, type-safe equality checks.

49|Updated May 12, 2026
One-click install
npx skills add https://github.com/senrecep/tsentials --skill tsentials-eq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsentials/eq
Source: https://github.com/senrecep/tsentials/tree/main/.well-known/agent-skills/tsentials-eq
Command: npx skills add https://github.com/senrecep/tsentials --skill tsentials-eq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves unreliable and inconsistent equality logic by giving you composable, type-safe, deterministic equality checks for TypeScript values.

Core Features & Use Cases

  • Primitive equality: Use built-in Eq instances for numbers, strings, booleans, and dates to compare values predictably.
  • Structural equality for objects: Use Eq.struct to compare plain objects field-by-field in a type-safe way.
  • Custom equality via projection: Use Eq.contramap to compare complex types by a derived key (such as an ID or name), and Eq.getArrayEq for element-wise array comparisons.

Quick Start

Use the tsentials/eq skill to build an Eq for your domain type by defining how each field should be compared, then compare two values to get a boolean result.

Frequently Asked Questions about tsentials/eq

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform type-safe equality checks for TypeScript objects during change detection?

Type-safe equality checks for TypeScript objects involve comparing values field-by-field using deterministic functional APIs. You can use a struct-based comparison to compare plain objects predictably, ensuring reliable change detection without inconsistent reference checks.

What is structural comparison in TypeScript and when do I need it?

Structural comparison in TypeScript is a mechanism that compares plain objects field-by-field rather than by memory reference. You need it when asserting equality between projected domain entities or primitives where deterministic deep matching is required.

How do I compare complex TypeScript types by a derived key like an ID?

You compare complex TypeScript types by a derived key using contramap-based projection. This approach allows you to define custom equality logic by projecting values to a specific primitive field, enabling type-safe comparisons based on business identifiers.

Does TypeScript provide built-in helpers for element-wise array equality?

TypeScript does not provide built-in helpers for element-wise array equality. You need to use a dedicated array equality helper to compare arrays deterministically, ensuring each element matches according to a defined type-safe equality rule.

What is the best way to deduplicate arrays of objects in TypeScript?

The best way to deduplicate arrays of objects in TypeScript is to apply a composable equality rule engine. By defining how each field should be compared, you can perform deterministic element-wise array equality checks to accurately filter duplicates.