샘플
@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: undefined…
sha256:81bf725f2df5024bdf2d0c6b67f5921e6ba253d8463420a59de6bcf1b148545e
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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.');
오리진 시더
익명