← Browse

@senrecep/tsentials-eq

A

Use when you need composable, type-safe equality checks.

skillclaude

Install

agr install @senrecep/tsentials-eq --target claude

Writes 1 file into .claude/skills/, pinned to git-6e3c1c92.

  • .claude/skills/tsentials-eq/SKILL.md

Document

tsentials/eq — Skill

Use when you need composable, type-safe equality checks.

API

import { Eq } from 'tsentials/eq';

// Primitive instances
Eq.number.equals(1, 1);   // true
Eq.string.equals('a', 'b'); // false
Eq.boolean.equals(true, true); // true
Eq.date.equals(new Date('2024-01-01'), new Date('2024-01-01')); // true

// Strict reference equality (any type)
Eq.strict.equals(obj1, obj2); // uses ===

// Derive Eq for custom types
interface User { readonly id: number; readonly name: string; }

const eqUser = Eq.struct<User>({ id: Eq.number, name: Eq.string });
eqUser.equals({ id: 1, name: 'A' }, { id: 1, name: 'A' }); // true

// Project before comparing
const eqByName = Eq.contramap(Eq.string, (u: User) => u.name);

// Array equality
const eqNumArray = Eq.getArrayEq(Eq.number);
eqNumArray.equals([1, 2], [1, 2]); // true

Patterns

  • Use Eq.struct for deep structural equality on plain objects.
  • Use Eq.contramap to compare complex objects by a single field.
  • Use Eq.getArrayEq for element-wise array comparison.

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-6e3c1c9258782026-07-31