サンプル
@jridgewell/gen-mapping 0.3.13: toDecodedMap
検証済みサンプル — npm @jridgewell/gen-mapping 0.3.13: toDecodedMap. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: toDecodedMap returns a valid v3…
sha256:92bcb085c91d2441ea3ee615d8b87d469aae38fe1ed7ae22592d5e37d3719540
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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-05 |
ケース
HOW- ゴール
- verify @jridgewell/gen-mapping.toDecodedMap in pkg:npm/%40jridgewell/gen-mapping@0.3.13
- シンボル
-
- @jridgewell/gen-mapping.toDecodedMap
- 環境
- node 22.23.2
- 作成日
- 2026-09-05T15:20:32Z
コントラクト
- toDecodedMap returns a valid v3 decoded source map structure with default fields
- toDecodedMap preserves file and sourceRoot metadata
- toDecodedMap extracts source file names into sources array
- toDecodedMap preserves inline source contents via sourcesContent array
- toDecodedMap records identifier names into names array with 5-field segment coordinates
- toDecodedMap generates 4-field decoded segments for mappings without symbol names
- toDecodedMap produces 1-field decoded segments for sourceless mappings
- toDecodedMap preserves ignoreList indices for debugger filtering
- toDecodedMap trims empty trailing lines from mappings array
- toDecodedMap supports multi-line mappings sorted by generated column order
ファイル
- 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 @jridgewell/gen-mapping.toDecodedMap in pkg:npm/%40jridgewell/gen-mapping@0.3.13
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40jridgewell/gen-mapping@0.3.13
Demonstrate these symbols/APIs:
- @jridgewell/gen-mapping.toDecodedMap
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.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:d292a7170ebe4c7e67db2247a850a11a37fc02d8f7237abc34b174063fcc23b2","constraints":{"executionContext":"node"},"contract":["toDecodedMap returns a valid v3 decoded source map structure with default fields","toDecodedMap preserves file and sourceRoot metadata","toDecodedMap extracts source file names into sources array","toDecodedMap preserves inline source contents via sourcesContent array","toDecodedMap records identifier names into names array with 5-field segment coordinates","toDecodedMap generates 4-field decoded segments for mappings without symbol names","toDecodedMap produces 1-field decoded segments for sourceless mappings","toDecodedMap preserves ignoreList indices for debugger filtering","toDecodedMap trims empty trailing lines from mappings array","toDecodedMap supports multi-line mappings sorted by generated column order"],"goal":"verify @jridgewell/gen-mapping.toDecodedMap in pkg:npm/%40jridgewell/gen-mapping@0.3.13","kind":"HOW","packages":["pkg:npm/%40jridgewell/gen-mapping@0.3.13"],"schemaVersion":1,"symbols":["@jridgewell/gen-mapping.toDecodedMap"]},"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/%40jridgewell/gen-mapping@0.3.13"],"schemaVersion":1,"subject":"pkg:npm/%40jridgewell/gen-mapping@0.3.13","symbols":["@jridgewell/gen-mapping.toDecodedMap"],"verifierAdapter":"node-typescript@1"}
{
"name": "gen-mapping-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "gen-mapping-sample",
"version": "1.0.0",
"dependencies": {
"@jridgewell/gen-mapping": "0.3.13"
}
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0",
"@jridgewell/trace-mapping": "^0.3.24"
}
},
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
"license": "MIT",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
"license": "MIT"
},
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.31",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
"integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
"license": "MIT",
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
"@jridgewell/sourcemap-codec": "^1.4.14"
}
}
}
}
{
"name": "gen-mapping-sample",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for @jridgewell/gen-mapping.toDecodedMap",
"dependencies": {
"@jridgewell/gen-mapping": "0.3.13"
}
}
{
"schemaVersion": 1,
"goal": "verify @jridgewell/gen-mapping.toDecodedMap in pkg:npm/%40jridgewell/gen-mapping@0.3.13",
"kind": "HOW",
"packages": [
"pkg:npm/%40jridgewell/gen-mapping@0.3.13"
],
"symbols": [
"@jridgewell/gen-mapping.toDecodedMap"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert from 'node:assert/strict';
import {
GenMapping,
addMapping,
addSegment,
setSourceContent,
setIgnore,
toDecodedMap,
} from '@jridgewell/gen-mapping';
// 1. toDecodedMap returns a valid v3 decoded source map structure with default fields
{
const map = new GenMapping();
const decoded = toDecodedMap(map);
assert.equal(decoded.version, 3);
assert.equal(decoded.file, undefined);
assert.equal(decoded.sourceRoot, undefined);
assert.deepEqual(decoded.sources, []);
assert.deepEqual(decoded.names, []);
assert.deepEqual(decoded.mappings, []);
assert.deepEqual(decoded.ignoreList, []);
}
// 2. toDecodedMap preserves file and sourceRoot metadata
{
const map = new GenMapping({
file: 'bundle.js',
sourceRoot: 'https://example.com/src/',
});
const decoded = toDecodedMap(map);
assert.equal(decoded.file, 'bundle.js');
assert.equal(decoded.sourceRoot, 'https://example.com/src/');
}
// 3. toDecodedMap extracts source file names into sources array
{
const map = new GenMapping();
addSegment(map, 0, 0, 'file-a.js', 0, 0);
addSegment(map, 0, 10, 'file-b.js', 0, 0);
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.sources, ['file-a.js', 'file-b.js']);
}
// 4. toDecodedMap preserves inline source contents via sourcesContent array
{
const map = new GenMapping();
addSegment(map, 0, 0, 'src.js', 0, 0);
setSourceContent(map, 'src.js', 'const x = 42;');
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.sourcesContent, ['const x = 42;']);
}
// 5. toDecodedMap records identifier names into names array with 5-field segment coordinates
{
const map = new GenMapping();
addMapping(map, {
generated: { line: 1, column: 0 },
source: 'foo.js',
original: { line: 1, column: 0 },
name: 'myFunction',
});
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.names, ['myFunction']);
assert.deepEqual(decoded.mappings, [[[0, 0, 0, 0, 0]]]);
}
// 6. toDecodedMap generates 4-field decoded segments for mappings without symbol names
{
const map = new GenMapping();
addMapping(map, {
generated: { line: 1, column: 5 },
source: 'bar.js',
original: { line: 10, column: 2 },
});
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.mappings, [[[5, 0, 9, 2]]]);
}
// 7. toDecodedMap produces 1-field decoded segments for sourceless mappings
{
const map = new GenMapping();
addSegment(map, 0, 12);
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.mappings, [[[12]]]);
}
// 8. toDecodedMap preserves ignoreList indices for debugger filtering
{
const map = new GenMapping();
addSegment(map, 0, 0, 'vendor/lib.js', 0, 0);
addSegment(map, 0, 5, 'app.js', 0, 0);
setIgnore(map, 'vendor/lib.js', true);
const decoded = toDecodedMap(map);
assert.deepEqual(decoded.ignoreList, [0]);
}
// 9. toDecodedMap trims empty trailing lines from mappings array
{
const map = new GenMapping();
addSegment(map, 0, 0, 'a.js', 0, 0);
const decoded = toDecodedMap(map);
assert.equal(decoded.mappings.length, 1);
assert.deepEqual(decoded.mappings[0], [[0, 0, 0, 0]]);
}
// 10. toDecodedMap supports multi-line mappings sorted by generated column order
{
const map = new GenMapping();
addSegment(map, 1, 10, 'a.js', 1, 5);
addSegment(map, 1, 0, 'a.js', 1, 0);
addSegment(map, 0, 0, 'a.js', 0, 0);
const decoded = toDecodedMap(map);
assert.equal(decoded.mappings.length, 2);
assert.deepEqual(decoded.mappings[0], [[0, 0, 0, 0]]);
assert.deepEqual(decoded.mappings[1], [
[0, 0, 1, 0],
[10, 0, 1, 5],
]);
}
console.log('Contract passed');
オリジンシーダー
匿名