Skip to content

attest: replace references to Node's builtin assertions #1287

Closed

Description

@ssalbdivad

attest currently relies on Node's builtin deepStrictEqual for its default .equals comparison, but this feels like a big problem:

import { type } from "arktype";
import assert from "node:assert/strict";

// Currently crashes with OOM exception
assert.deepStrictEqual(type.string, type.boolean);

I'd like to find either a simple string diffing implementation we could use internally based on generate .snap contents or some targeted external solution for this without these issues (and potentially also clearer diffs).

In the meantime I will try to avoid this specific case happening by ensuring we only compare functions based on reference equality or similar.

Activity

  1. PointSingularity commented on Feb 1, 2025

    @PointSingularity

    Here are some potential options:

  2. moved this from To do to Backlog in arktypeioon Feb 4, 2025
  3. ssalbdivad commented on Nov 18, 2026

    @ssalbdivad
    MemberAuthor

    Fixed in 3.0.0-beta.0 (#1728). Try it with npm i arktype@next.

  4. moved this from Backlog to Done (merged or closed) in arktypeioon Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done (merged or closed)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions