샘플
flatted 3.4.3
검증된 샘플 — npm flatted 3.4.3. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: flatted.stringify and flatted.parse round-trip primitive values…
sha256:eb6d3e3d0b2b75396d62336f84876fa6dfa8555240916c465d305547bb3a5ce6
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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-27 |
케이스
HOW- 목표
- verify pkg:npm/flatted@3.4.3
- 패키지
- 환경
- node 22.23.2
- 생성일
- 2026-08-27T17:06:20Z
컨트랙트
- flatted.stringify and flatted.parse round-trip primitive values, objects, and arrays
- flatted.stringify serializes direct self-referencing circular structures without infinite recursion
- flatted.parse deserializes circular structures preserving circular object identity and references
- flatted.stringify and flatted.parse handle mutually circular references between multiple objects
- flatted.stringify preserves repeated references to the same object across multiple properties without duplication
- flatted.stringify supports custom replacer function and custom indentation formatting
- flatted.parse supports custom reviver function during deserialization traversal
- flatted.toJSON converts complex circular object graph into serialized flatted array structure
- flatted.fromJSON reconstructs original circular object graph from flatted array structure
- flatted.parse throws SyntaxError on malformed or corrupted JSON string
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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/flatted@3.4.3
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/flatted@3.4.3
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:c66db350f3e2adecf5aeef57b73dbdc06ec50c1e53f5846517b4a98824b5dc50","constraints":{"executionContext":"node"},"contract":["flatted.stringify and flatted.parse round-trip primitive values, objects, and arrays","flatted.stringify serializes direct self-referencing circular structures without infinite recursion","flatted.parse deserializes circular structures preserving circular object identity and references","flatted.stringify and flatted.parse handle mutually circular references between multiple objects","flatted.stringify preserves repeated references to the same object across multiple properties without duplication","flatted.stringify supports custom replacer function and custom indentation formatting","flatted.parse supports custom reviver function during deserialization traversal","flatted.toJSON converts complex circular object graph into serialized flatted array structure","flatted.fromJSON reconstructs original circular object graph from flatted array structure","flatted.parse throws SyntaxError on malformed or corrupted JSON string"],"goal":"verify pkg:npm/flatted@3.4.3","kind":"HOW","packages":["pkg:npm/flatted@3.4.3"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"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/flatted@3.4.3"],"schemaVersion":1,"subject":"pkg:npm/flatted@3.4.3","verifierAdapter":"node-typescript@1"}
{
"name": "sample-1868502681",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-1868502681",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"flatted": "3.4.3"
}
},
"node_modules/flatted": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.3.tgz",
"integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==",
"license": "ISC"
}
}
}
{
"name": "sample-1868502681",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node test/contract.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"flatted": "3.4.3"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/flatted@3.4.3",
"kind": "HOW",
"packages": [
"pkg:npm/flatted@3.4.3"
]
}
import assert from 'node:assert/strict';
import { parse, stringify, toJSON, fromJSON } from 'flatted';
// 1. flatted.stringify and flatted.parse round-trip primitive values, objects, and arrays
{
assert.equal(parse(stringify(42)), 42);
assert.equal(parse(stringify('hello')), 'hello');
assert.equal(parse(stringify(true)), true);
assert.equal(parse(stringify(null)), null);
assert.deepEqual(parse(stringify([1, 2, 3])), [1, 2, 3]);
assert.deepEqual(parse(stringify({ a: 1, b: 'two', c: [true, false] })), { a: 1, b: 'two', c: [true, false] });
}
// 2. flatted.stringify serializes direct self-referencing circular structures without infinite recursion
{
const obj = { name: 'self' };
obj.self = obj;
const str = stringify(obj);
assert.equal(typeof str, 'string');
assert.ok(str.length > 0);
}
// 3. flatted.parse deserializes circular structures preserving circular object identity and references
{
const original = { title: 'cycle' };
original.ref = original;
const parsed = parse(stringify(original));
assert.equal(parsed.title, 'cycle');
assert.equal(parsed.ref, parsed);
assert.equal(parsed.ref.ref, parsed);
}
// 4. flatted.stringify and flatted.parse handle mutually circular references between multiple objects
{
const parent = { name: 'parent' };
const child = { name: 'child' };
parent.child = child;
child.parent = parent;
const parsed = parse(stringify(parent));
assert.equal(parsed.name, 'parent');
assert.equal(parsed.child.name, 'child');
assert.equal(parsed.child.parent, parsed);
assert.equal(parsed.child.parent.child, parsed.child);
}
// 5. flatted.stringify preserves repeated references to the same object across multiple properties without duplication
{
const shared = { sharedValue: 'common' };
const root = { first: shared, second: shared, items: [shared] };
const parsed = parse(stringify(root));
assert.equal(parsed.first, parsed.second);
assert.equal(parsed.items[0], parsed.first);
parsed.first.sharedValue = 'updated';
assert.equal(parsed.second.sharedValue, 'updated');
}
// 6. flatted.stringify supports custom replacer function and custom indentation formatting
{
const data = { secret: 'hide', visible: 'show', num: 10 };
const replacer = (key, value) => (key === 'secret' ? undefined : value);
const formatted = stringify(data, replacer, 2);
assert.ok(formatted.includes('\n'));
assert.ok(formatted.includes(' '));
const parsed = parse(formatted);
assert.equal(parsed.secret, undefined);
assert.equal(parsed.visible, 'show');
}
// 7. flatted.parse supports custom reviver function during deserialization traversal
{
const data = { count: 5, label: 'items' };
const revived = parse(stringify(data), (key, value) => {
if (key === 'count') return value * 2;
return value;
});
assert.equal(revived.count, 10);
assert.equal(revived.label, 'items');
}
// 8. flatted.toJSON converts complex circular object graph into serialized flatted array structure
{
const circular = { id: 1 };
circular.self = circular;
const jsonArr = toJSON(circular);
assert.ok(Array.isArray(jsonArr));
assert.equal(typeof jsonArr[0], 'object');
}
// 9. flatted.fromJSON reconstructs original circular object graph from flatted array structure
{
const circular = { id: 42, meta: 'test' };
circular.self = circular;
const jsonArr = toJSON(circular);
const reconstructed = fromJSON(jsonArr);
assert.equal(reconstructed.id, 42);
assert.equal(reconstructed.meta, 'test');
assert.equal(reconstructed.self, reconstructed);
}
// 10. flatted.parse throws SyntaxError on malformed or corrupted JSON string
{
assert.throws(() => parse('{"unclosed":'), SyntaxError);
assert.throws(() => parse('not-a-json'), SyntaxError);
}
console.log('Contract passed');
오리진 시더
익명