サンプル
serialize-error 7.0.1: deserializeError
検証済みサンプル — npm serialize-error 7.0.1: deserializeError. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: deserializeError passes through existing…
sha256:7f2cdd9a3cdb14f1ea397cab46e7100165443c892969a2d019a49a135ee18903
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-04 |
ケース
HOW- ゴール
- verify serialize-error.deserializeError in pkg:npm/serialize-error@7.0.1
- パッケージ
- シンボル
-
- serialize-error.deserializeError
- 作成日
- 2026-09-04T11:13:33Z
コントラクト
- deserializeError passes through existing Error instances unchanged
- deserializeError deserializes error object restoring name, message, stack, and code
- deserializeError preserves custom enumerable properties on error object
- deserializeError keeps name, message, and stack as non-enumerable properties
- deserializeError handles circular references in custom properties
- deserializeError ignores function properties on serialized object
- deserializeError wraps primitive string value into NonError instance
- deserializeError wraps primitive number and boolean into NonError instance
- deserializeError wraps null and undefined into NonError instance
- deserializeError wraps array into NonError instance
ファイル
- 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 serialize-error.deserializeError in pkg:npm/serialize-error@7.0.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/serialize-error@7.0.1
Demonstrate these symbols/APIs:
- serialize-error.deserializeError
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:71816cb67851b502adba12b13de4efd213889050319a2dd4811911c788ab405a","contract":["deserializeError passes through existing Error instances unchanged","deserializeError deserializes error object restoring name, message, stack, and code","deserializeError preserves custom enumerable properties on error object","deserializeError keeps name, message, and stack as non-enumerable properties","deserializeError handles circular references in custom properties","deserializeError ignores function properties on serialized object","deserializeError wraps primitive string value into NonError instance","deserializeError wraps primitive number and boolean into NonError instance","deserializeError wraps null and undefined into NonError instance","deserializeError wraps array into NonError instance"],"goal":"verify serialize-error.deserializeError in pkg:npm/serialize-error@7.0.1","kind":"HOW","packages":["pkg:npm/serialize-error@7.0.1"],"schemaVersion":1,"symbols":["serialize-error.deserializeError"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/serialize-error@7.0.1"],"schemaVersion":1,"subject":"pkg:npm/serialize-error@7.0.1","symbols":["serialize-error.deserializeError"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-serialize-error-deserialize-error",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-serialize-error-deserialize-error",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"serialize-error": "7.0.1"
}
},
"node_modules/serialize-error": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
"integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
"license": "MIT",
"dependencies": {
"type-fest": "^0.13.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/type-fest": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
"license": "(MIT OR CC0-1.0)",
"engines": {
"node": ">=10"
}
}
}
}
{
"name": "sample-serialize-error-deserialize-error",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"serialize-error": "7.0.1"
}
}
{
"schemaVersion": 1,
"goal": "verify serialize-error.deserializeError in pkg:npm/serialize-error@7.0.1",
"kind": "HOW",
"packages": [
"pkg:npm/serialize-error@7.0.1"
],
"symbols": [
"serialize-error.deserializeError"
]
}
import assert from 'node:assert/strict';
import { deserializeError } from 'serialize-error';
// 1. deserializeError passes through existing Error instances unchanged
{
const err = new TypeError('original error');
const result = deserializeError(err);
assert.equal(result, err);
assert.equal(result instanceof TypeError, true);
}
// 2. deserializeError deserializes error object restoring name, message, stack, and code
{
const serialized = {
name: 'CustomError',
message: 'failed operation',
stack: 'CustomError: failed operation\n at Object.<anonymous>',
code: 'ERR_FAILED'
};
const result = deserializeError(serialized);
assert.equal(result instanceof Error, true);
assert.equal(result.name, 'CustomError');
assert.equal(result.message, 'failed operation');
assert.equal(result.stack, 'CustomError: failed operation\n at Object.<anonymous>');
assert.equal(result.code, 'ERR_FAILED');
}
// 3. deserializeError preserves custom enumerable properties on error object
{
const serialized = {
message: 'with details',
status: 404,
context: { userId: '123' }
};
const result = deserializeError(serialized);
assert.equal(result.status, 404);
assert.deepEqual(result.context, { userId: '123' });
}
// 4. deserializeError keeps name, message, and stack as non-enumerable properties
{
const serialized = {
name: 'MyError',
message: 'secret message',
stack: 'stack line',
code: 'ERR_CODE',
custom: 'visible'
};
const result = deserializeError(serialized);
const keys = Object.keys(result);
assert.equal(keys.includes('name'), false);
assert.equal(keys.includes('message'), false);
assert.equal(keys.includes('stack'), false);
assert.equal(keys.includes('code'), true);
assert.equal(keys.includes('custom'), true);
}
// 5. deserializeError handles circular references in custom properties
{
const circular = { message: 'circular test', nested: {} };
circular.nested.self = circular.nested;
const result = deserializeError(circular);
assert.equal(result.nested.self, '[Circular]');
}
// 6. deserializeError ignores function properties on serialized object
{
const serialized = {
message: 'fn test',
helper: () => 'noop'
};
const result = deserializeError(serialized);
assert.equal('helper' in result, false);
}
// 7. deserializeError wraps primitive string value into NonError instance
{
const result = deserializeError('something bad');
assert.equal(result instanceof Error, true);
assert.equal(result.name, 'NonError');
assert.equal(result.message, '"something bad"');
}
// 8. deserializeError wraps primitive number and boolean into NonError instance
{
const numResult = deserializeError(404);
assert.equal(numResult.name, 'NonError');
assert.equal(numResult.message, '404');
const boolResult = deserializeError(false);
assert.equal(boolResult.name, 'NonError');
assert.equal(boolResult.message, 'false');
}
// 9. deserializeError wraps null and undefined into NonError instance
{
const nullResult = deserializeError(null);
assert.equal(nullResult.name, 'NonError');
assert.equal(nullResult.message, 'null');
const undefResult = deserializeError(undefined);
assert.equal(undefResult.name, 'NonError');
assert.equal(undefResult.message, '');
}
// 10. deserializeError wraps array into NonError instance
{
const arrResult = deserializeError(['error1', 'error2']);
assert.equal(arrResult.name, 'NonError');
assert.equal(arrResult.message, '["error1","error2"]');
}
オリジンシーダー
匿名