サンプル
@jest/get-type 30.1.0: getType
検証済みサンプル — npm @jest/get-type 30.1.0: getType. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: getType identifies JavaScript primitives…
sha256:81bf725f2df5024bdf2d0c6b67f5921e6ba253d8463420a59de6bcf1b148545e
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。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 @jest/get-type.getType in pkg:npm/%40jest/get-type@30.1.0
- パッケージ
- シンボル
-
- @jest/get-type.getType
- 環境
- node 22.23.2
- 作成日
- 2026-09-05T23:53:57Z
コントラクト
- getType identifies JavaScript primitives: undefined, null, boolean, number, string, symbol, and bigint
- getType identifies built-in collection and object types: array, map, set, date, and regexp
- getType distinguishes plain objects and functions from specialized built-ins
ファイル
- PROMPT.md
- csx.json
- index.js
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
ソース
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 @jest/get-type.getType in pkg:npm/%40jest/get-type@30.1.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40jest/get-type@30.1.0
Demonstrate these symbols/APIs:
- @jest/get-type.getType
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:36de8895f4a0173af1e3fcc7329f4a21ac5e2601eadde7ed740509b8e9b261c8","contract":["getType identifies JavaScript primitives: undefined, null, boolean, number, string, symbol, and bigint","getType identifies built-in collection and object types: array, map, set, date, and regexp","getType distinguishes plain objects and functions from specialized built-ins"],"goal":"verify @jest/get-type.getType in pkg:npm/%40jest/get-type@30.1.0","kind":"HOW","packages":["pkg:npm/%40jest/get-type@30.1.0"],"schemaVersion":1,"symbols":["@jest/get-type.getType"]},"contractCommand":["node","test/contract.cjs"],"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/%40jest/get-type@30.1.0"],"schemaVersion":1,"subject":"pkg:npm/%40jest/get-type@30.1.0","symbols":["@jest/get-type.getType"],"verifierAdapter":"node-typescript@1"}
'use strict';
const { getType } = require('@jest/get-type');
function categorizeValue(value) {
return getType(value);
}
module.exports = {
getType,
categorizeValue
};
{
"name": "sample-jest-get-type",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-jest-get-type",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@jest/get-type": "30.1.0"
}
},
"node_modules/@jest/get-type": {
"version": "30.1.0",
"resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz",
"integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==",
"license": "MIT",
"engines": {
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
}
}
}
}
{
"name": "sample-jest-get-type",
"version": "1.0.0",
"private": true,
"description": "verify @jest/get-type.getType in pkg:npm/%40jest/get-type@30.1.0",
"main": "index.js",
"scripts": {
"test": "node test/contract.cjs"
},
"dependencies": {
"@jest/get-type": "30.1.0"
},
"license": "MIT-0"
}
{
"schemaVersion": 1,
"goal": "verify @jest/get-type.getType in pkg:npm/%40jest/get-type@30.1.0",
"kind": "HOW",
"packages": [
"pkg:npm/%40jest/get-type@30.1.0"
],
"symbols": [
"@jest/get-type.getType"
]
}
'use strict';
const assert = require('node:assert/strict');
const { getType, categorizeValue } = require('../index.js');
const jestGetType = require('@jest/get-type');
// Verify exported functions
assert.strictEqual(typeof jestGetType.getType, 'function', 'getType must be exported as a function');
assert.strictEqual(typeof getType, 'function', 'getType must be re-exported');
assert.strictEqual(typeof categorizeValue, 'function', 'categorizeValue helper must be a function');
// Assertion 1: getType identifies JavaScript primitives: undefined, null, boolean, number, string, symbol, and bigint
assert.strictEqual(getType(undefined), 'undefined');
assert.strictEqual(getType(null), 'null');
assert.strictEqual(getType(true), 'boolean');
assert.strictEqual(getType(false), 'boolean');
assert.strictEqual(getType(0), 'number');
assert.strictEqual(getType(42), 'number');
assert.strictEqual(getType(-3.14), 'number');
assert.strictEqual(getType(NaN), 'number');
assert.strictEqual(getType(Infinity), 'number');
assert.strictEqual(getType(''), 'string');
assert.strictEqual(getType('hello world'), 'string');
assert.strictEqual(getType(Symbol('sym')), 'symbol');
assert.strictEqual(getType(Symbol.for('key')), 'symbol');
assert.strictEqual(getType(0n), 'bigint');
assert.strictEqual(getType(9007199254740991n), 'bigint');
// Assertion 2: getType identifies built-in collection and object types: array, map, set, date, and regexp
assert.strictEqual(getType([]), 'array');
assert.strictEqual(getType([1, 2, 3]), 'array');
assert.strictEqual(getType(new Array(5)), 'array');
assert.strictEqual(getType(new Map()), 'map');
assert.strictEqual(getType(new Set()), 'set');
assert.strictEqual(getType(new Date()), 'date');
assert.strictEqual(getType(/abc/), 'regexp');
assert.strictEqual(getType(new RegExp('xyz')), 'regexp');
// Assertion 3: getType distinguishes plain objects and functions from specialized built-ins
assert.strictEqual(getType({}), 'object');
assert.strictEqual(getType({ a: 1, b: 'two' }), 'object');
assert.strictEqual(getType(Object.create(null)), 'object');
assert.strictEqual(getType(() => {}), 'function');
assert.strictEqual(getType(function named() {}), 'function');
assert.strictEqual(getType(async () => {}), 'function');
// Helper function validation
assert.strictEqual(categorizeValue('test'), 'string');
assert.strictEqual(categorizeValue([10]), 'array');
assert.strictEqual(categorizeValue({ key: 'value' }), 'object');
console.log('Contract tests passed successfully.');
オリジンシーダー
匿名