샘플
deep-eql 5.0.2
검증된 샘플 — npm deep-eql 5.0.2. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: deepEqual returns true for identical primitives and false for…
sha256:d71bbf243ca68e5038a2bf5806b394836dbbe503038b8e8f9fed49ab3639a4d1
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
케이스
HOW- 목표
- verify pkg:npm/deep-eql@5.0.2
- 패키지
- 환경
- node 22.23.2
- 생성일
- 2026-08-26T08:58:24Z
컨트랙트
- deepEqual returns true for identical primitives and false for distinct primitives
- deepEqual treats NaN as equal to NaN and distinguishes +0 from -0
- deepEqual evaluates Date instances by their timestamps
- deepEqual evaluates RegExp instances by their source pattern and flags
- deepEqual evaluates Error instances by name, message, and code properties
- deepEqual evaluates nested arrays, sets, and maps recursively
- deepEqual evaluates nested objects regardless of key order and includes symbol properties
- deepEqual handles circular references without throwing stack overflow errors
- deepEqual supports custom comparator functions to override equality logic
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
소스
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/deep-eql@5.0.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/deep-eql@5.0.2
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:44195a7faefa05a8dc53eba125344dc225498763dd90c5329bf54037fa70cf1d","contract":["deepEqual returns true for identical primitives and false for distinct primitives","deepEqual treats NaN as equal to NaN and distinguishes +0 from -0","deepEqual evaluates Date instances by their timestamps","deepEqual evaluates RegExp instances by their source pattern and flags","deepEqual evaluates Error instances by name, message, and code properties","deepEqual evaluates nested arrays, sets, and maps recursively","deepEqual evaluates nested objects regardless of key order and includes symbol properties","deepEqual handles circular references without throwing stack overflow errors","deepEqual supports custom comparator functions to override equality logic"],"goal":"verify pkg:npm/deep-eql@5.0.2","kind":"HOW","packages":["pkg:npm/deep-eql@5.0.2"],"schemaVersion":1},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/deep-eql@5.0.2"],"schemaVersion":1,"subject":"pkg:npm/deep-eql@5.0.2","verifierAdapter":"node-typescript@1"}
{
"name": "sample-deep-eql",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-deep-eql",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"deep-eql": "5.0.2"
}
},
"node_modules/deep-eql": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
"integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
"license": "MIT",
"engines": {
"node": ">=6"
}
}
}
}
{
"name": "sample-deep-eql",
"version": "1.0.0",
"description": "verify pkg:npm/deep-eql@5.0.2",
"main": "src/index.js",
"scripts": {
"test": "node test/contract.js"
},
"dependencies": {
"deep-eql": "5.0.2"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/deep-eql@5.0.2",
"kind": "HOW",
"packages": [
"pkg:npm/deep-eql@5.0.2"
]
}
'use strict';
const deepEqlModule = require('deep-eql');
const deepEqual = deepEqlModule.default || deepEqlModule;
const { MemoizeMap } = deepEqlModule;
/**
* Compare two values for deep equality according to the deep-eql algorithm.
*
* @param {*} actual - The value to test.
* @param {*} expected - The expected value.
* @param {Object} [options] - Optional comparison options (e.g. comparator, memoize).
* @returns {boolean} True if values are deeply equal, false otherwise.
*/
function isEqual(actual, expected, options) {
return deepEqual(actual, expected, options);
}
module.exports = {
deepEqual,
isEqual,
MemoizeMap
};
'use strict';
const assert = require('assert');
const { deepEqual, isEqual, MemoizeMap } = require('../src/index');
// 1. Module export verification
{
assert.strictEqual(typeof deepEqual, 'function');
assert.strictEqual(typeof isEqual, 'function');
assert.strictEqual(typeof MemoizeMap, 'function');
}
// 2. deepEqual returns true for identical primitives and false for distinct primitives
{
assert.strictEqual(deepEqual(1, 1), true);
assert.strictEqual(deepEqual('hello', 'hello'), true);
assert.strictEqual(deepEqual(true, true), true);
assert.strictEqual(deepEqual(null, null), true);
assert.strictEqual(deepEqual(undefined, undefined), true);
assert.strictEqual(deepEqual(1, 2), false);
assert.strictEqual(deepEqual('a', 'b'), false);
assert.strictEqual(deepEqual(true, false), false);
assert.strictEqual(deepEqual(null, undefined), false);
}
// 3. deepEqual treats NaN as equal to NaN and distinguishes +0 from -0
{
assert.strictEqual(deepEqual(NaN, NaN), true);
assert.strictEqual(isEqual(NaN, NaN), true);
assert.strictEqual(deepEqual([NaN], [NaN]), true);
assert.strictEqual(deepEqual({ val: NaN }, { val: NaN }), true);
assert.strictEqual(deepEqual(0, 0), true);
assert.strictEqual(deepEqual(-0, -0), true);
assert.strictEqual(deepEqual(0, -0), false);
assert.strictEqual(deepEqual(-0, 0), false);
assert.strictEqual(deepEqual([0], [-0]), false);
assert.strictEqual(deepEqual({ n: 0 }, { n: -0 }), false);
}
// 4. deepEqual evaluates Date instances by their timestamps
{
const d1 = new Date(1700000000000);
const d2 = new Date(1700000000000);
const d3 = new Date(1700000000001);
assert.strictEqual(deepEqual(d1, d2), true);
assert.strictEqual(deepEqual(d1, d3), false);
}
// 5. deepEqual evaluates RegExp instances by their source pattern and flags
{
const r1 = /abc/gi;
const r2 = /abc/gi;
const r3 = /abc/g;
const r4 = /def/gi;
assert.strictEqual(deepEqual(r1, r2), true);
assert.strictEqual(deepEqual(r1, r3), false);
assert.strictEqual(deepEqual(r1, r4), false);
}
// 6. deepEqual evaluates Error instances by name, message, and code properties
{
const e1 = new Error('something failed');
const e2 = new Error('something failed');
const e3 = new Error('different message');
const te = new TypeError('something failed');
assert.strictEqual(deepEqual(e1, e2), true);
assert.strictEqual(deepEqual(e1, e3), false);
assert.strictEqual(deepEqual(e1, te), false);
const eCode1 = Object.assign(new Error('err'), { code: 'ERR_CUSTOM' });
const eCode2 = Object.assign(new Error('err'), { code: 'ERR_CUSTOM' });
const eCode3 = Object.assign(new Error('err'), { code: 'ERR_OTHER' });
assert.strictEqual(deepEqual(eCode1, eCode2), true);
assert.strictEqual(deepEqual(eCode1, eCode3), false);
const eExtra1 = Object.assign(new Error('err'), { otherProp: 1 });
const eExtra2 = Object.assign(new Error('err'), { otherProp: 2 });
assert.strictEqual(deepEqual(eExtra1, eExtra2), true);
}
// 7. deepEqual evaluates nested arrays, sets, and maps recursively
{
assert.strictEqual(deepEqual([1, [2, [3]]], [1, [2, [3]]]), true);
assert.strictEqual(deepEqual([1, 2, 3], [1, 2, 4]), false);
const set1 = new Set(['a', 'b', 3]);
const set2 = new Set(['b', 'a', 3]);
const set3 = new Set(['a', 'b', 4]);
assert.strictEqual(deepEqual(set1, set2), true);
assert.strictEqual(deepEqual(set1, set3), false);
const map1 = new Map([['k1', { x: 1 }], ['k2', { y: 2 }]]);
const map2 = new Map([['k1', { x: 1 }], ['k2', { y: 2 }]]);
const map3 = new Map([['k1', { x: 1 }], ['k2', { y: 99 }]]);
assert.strictEqual(deepEqual(map1, map2), true);
assert.strictEqual(deepEqual(map1, map3), false);
}
// 8. deepEqual evaluates nested objects regardless of key order and includes symbol properties
{
assert.strictEqual(deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }), true);
assert.strictEqual(
deepEqual({ nested: { x: 10, y: 20 } }, { nested: { y: 20, x: 10 } }),
true
);
assert.strictEqual(deepEqual({ a: 1, b: 2 }, { a: 1, b: 3 }), false);
const sym = Symbol('test');
const objSym1 = { [sym]: 'val', normal: 1 };
const objSym2 = { [sym]: 'val', normal: 1 };
const objSym3 = { [sym]: 'other', normal: 1 };
assert.strictEqual(deepEqual(objSym1, objSym2), true);
assert.strictEqual(deepEqual(objSym1, objSym3), false);
}
// 9. deepEqual handles circular references without throwing stack overflow errors
{
const circA = { val: 1 };
circA.self = circA;
const circB = { val: 1 };
circB.self = circB;
const circC = { val: 2 };
circC.self = circC;
assert.strictEqual(deepEqual(circA, circB), true);
assert.strictEqual(deepEqual(circA, circC), false);
}
// 10. deepEqual supports custom comparator functions to override equality logic
{
const customComparator = (a, b) => {
if (typeof a === 'number' && typeof b === 'number') {
return Math.abs(a - b) < 0.05;
}
return null;
};
assert.strictEqual(
deepEqual({ val: 1.01 }, { val: 1.03 }, { comparator: customComparator }),
true
);
assert.strictEqual(
deepEqual({ val: 1.01 }, { val: 1.20 }, { comparator: customComparator }),
false
);
}
console.log('All deep-eql contract tests passed.');
오리진 시더
익명