Пример
@babel/runtime 7.29.7
Проверенный пример — npm @babel/runtime 7.29.7. Контракт выполнен на node 22 · linux alpine/x64 · docker и пройден: assert _typeof correctly identifies…
sha256:39e1c5c7acbf92e2982a833c1ee7e0cf622d22b63d12e8e165c4e8990ce6d781
Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла.
Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди.
MIT-0
Свидетельства выполнения
Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.
- Основа свидетельства
- Подписанный контракт пройден
- Квитанции проверки
- 1
- Ключи подписи, собравшие его
- 1
Заявленная среда
linux 24 · ubuntu · glibc 2.39 x64 npm
Среды запусков проверки
| Окружение | Контракт | Этапы | Запуск |
|---|---|---|---|
| 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-28 |
Кейс
HOW- Цель
- verify pkg:npm/@babel/runtime@7.29.7
- Пакеты
- Создан
- 2026-08-28T07:47:33Z
Контракт
- assert _typeof correctly identifies primitives, objects, and symbols
- assert _objectSpread2 merges object properties and symbol keys
- assert _toConsumableArray converts iterables and sets into arrays
- assert _slicedToArray extracts elements from iterables and arrays
- assert _classCallCheck throws TypeError when constructor is called without new
- assert _createClass attaches instance methods to prototype and static methods to constructor
- assert _interopRequireDefault handles ES module default export and CommonJS wrappers
- assert regeneratorRuntime provides generator helper methods mark and wrap
Файлы
- NOTES.md
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Исходный код
# @babel/runtime Helper Notes
`@babel/runtime` provides modular runtime helpers used by Babel plugins when compiling ES2015+ features:
- `helpers/typeof`: Ensures Symbol and primitive type detection behaves consistently across environments.
- `helpers/objectSpread2`: Implements ES object spread syntax (`...obj`) preserving property descriptors and symbols.
- `helpers/toConsumableArray`: Implements array spread syntax for iterables and sets.
- `helpers/slicedToArray`: Implements array destructuring (`const [a, b] = iterable`).
- `helpers/classCallCheck`: Enforces that constructor functions cannot be invoked without `new`.
- `helpers/createClass`: Configures prototype methods and static properties with proper descriptor flags.
- `helpers/interopRequireDefault`: Normalizes default import semantics across ESM and CommonJS modules.
- `regenerator`: Exposes the regenerator runtime for generator function transformation.
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/@babel/runtime@7.29.7
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40babel/runtime@7.29.7
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:78effb58ee4de1dd4adec247c3f51ae04f26c996564d1c07a80d7ecaf232de2b","contract":["assert _typeof correctly identifies primitives, objects, and symbols","assert _objectSpread2 merges object properties and symbol keys","assert _toConsumableArray converts iterables and sets into arrays","assert _slicedToArray extracts elements from iterables and arrays","assert _classCallCheck throws TypeError when constructor is called without new","assert _createClass attaches instance methods to prototype and static methods to constructor","assert _interopRequireDefault handles ES module default export and CommonJS wrappers","assert regeneratorRuntime provides generator helper methods mark and wrap"],"goal":"verify pkg:npm/@babel/runtime@7.29.7","kind":"HOW","packages":["pkg:npm/%40babel/runtime@7.29.7"],"schemaVersion":1},"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/%40babel/runtime@7.29.7"],"schemaVersion":1,"subject":"pkg:npm/%40babel/runtime@7.29.7","verifierAdapter":"node-typescript@1"}
{
"name": "npm-babel-runtime-contract",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "npm-babel-runtime-contract",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@babel/runtime": "7.29.7"
}
},
"node_modules/@babel/runtime": {
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
}
}
}
{
"name": "npm-babel-runtime-contract",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"@babel/runtime": "7.29.7"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/@babel/runtime@7.29.7",
"kind": "HOW",
"packages": [
"pkg:npm/%40babel/runtime@7.29.7"
]
}
import assert from 'node:assert/strict';
import _typeof from '@babel/runtime/helpers/typeof';
import _objectSpread2 from '@babel/runtime/helpers/objectSpread2';
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
import _createClass from '@babel/runtime/helpers/createClass';
import _interopRequireDefault from '@babel/runtime/helpers/interopRequireDefault';
import regeneratorRuntime from '@babel/runtime/regenerator';
// 1. _typeof correctly identifies primitives, objects, and symbols
assert.equal(_typeof('hello'), 'string');
assert.equal(_typeof(42), 'number');
assert.equal(_typeof(Symbol('sym')), 'symbol');
assert.equal(_typeof({ key: 'val' }), 'object');
assert.equal(_typeof(null), 'object');
assert.equal(_typeof(undefined), 'undefined');
// 2. _objectSpread2 merges object properties and symbol keys
const symKey = Symbol('custom');
const sourceObj = { b: 2, [symKey]: 'secret' };
const targetObj = { a: 1 };
const merged = _objectSpread2(targetObj, sourceObj);
assert.equal(merged.a, 1);
assert.equal(merged.b, 2);
assert.equal(merged[symKey], 'secret');
// 3. _toConsumableArray converts iterables and sets into arrays
const set = new Set(['alpha', 'beta', 'gamma']);
const arrayFromSet = _toConsumableArray(set);
assert.deepEqual(arrayFromSet, ['alpha', 'beta', 'gamma']);
assert.ok(Array.isArray(arrayFromSet));
// 4. _slicedToArray extracts elements from iterables and arrays
const iterable = new Set([10, 20, 30]);
const slicedIterable = _slicedToArray(iterable, 2);
assert.deepEqual(slicedIterable, [10, 20]);
const arrayInput = [10, 20, 30];
const slicedArray = _slicedToArray(arrayInput, 2);
assert.equal(slicedArray[0], 10);
assert.equal(slicedArray[1], 20);
// 5. _classCallCheck throws TypeError when constructor is called without new
function DemoClass() {
_classCallCheck(this, DemoClass);
}
assert.doesNotThrow(() => new DemoClass());
assert.throws(
() => {
DemoClass.call({});
},
{
name: 'TypeError',
message: 'Cannot call a class as a function',
}
);
// 6. _createClass attaches instance methods to prototype and static methods to constructor
_createClass(
DemoClass,
[
{
key: 'instanceMethod',
value: function () {
return 'instance result';
},
},
],
[
{
key: 'staticMethod',
value: function () {
return 'static result';
},
},
]
);
const instance = new DemoClass();
assert.equal(instance.instanceMethod(), 'instance result');
assert.equal(DemoClass.staticMethod(), 'static result');
// 7. _interopRequireDefault handles ES module default export and CommonJS wrappers
const esmModule = { __esModule: true, default: { greeting: 'hello' } };
assert.deepEqual(_interopRequireDefault(esmModule), esmModule);
const cjsModule = { greeting: 'hello' };
assert.deepEqual(_interopRequireDefault(cjsModule), { default: cjsModule });
// 8. regeneratorRuntime provides generator helper methods mark and wrap
assert.ok(regeneratorRuntime);
assert.equal(typeof regeneratorRuntime.mark, 'function');
assert.equal(typeof regeneratorRuntime.wrap, 'function');
console.log('babel-runtime.contract.pass');
Исходный сидер
аноним