Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ssalbdivad opened this issue Feb 1, 2025 · 1 comment
Open

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

ssalbdivad opened this issue Feb 1, 2025 · 1 comment

Comments

@ssalbdivad
Copy link
Member

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.

@PointSingularity
Copy link

Here are some potential options:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

2 participants