샘플
jest-get-type 29.6.3: getType
검증된 샘플 — npm jest-get-type 29.6.3: getType. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: getType is exported as a function
sha256:873c5e9eaf2c8ce27c394621a7f596347994fe6cfc882a8da5630150c9e9d5cc
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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@1 |
2026-08-21 |
케이스
HOW- 목표
- verify pkg:npm/jest-get-type@29.6.3
- 심벌
-
- getType
- 생성일
- 2026-08-21T05:49:24Z
컨트랙트
- getType is exported as a function
- getType accurately distinguishes primitive values including undefined, null, boolean, number, bigint, string, and symbol
- getType accurately distinguishes built-in objects including array, regexp, map, set, and date
- getType identifies standard functions, arrow functions, generator functions, async functions, and class constructors as function
- getType identifies plain objects and objects created with Object.create(null) as object
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- 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 pkg:npm/jest-get-type@29.6.3
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/jest-get-type@29.6.3
Demonstrate these symbols/APIs:
- 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:9746989da034b3481bc7bb5b424817f37091684d7f8eee54c873402ecc42504b","contract":["getType is exported as a function","getType accurately distinguishes primitive values including undefined, null, boolean, number, bigint, string, and symbol","getType accurately distinguishes built-in objects including array, regexp, map, set, and date","getType identifies standard functions, arrow functions, generator functions, async functions, and class constructors as function","getType identifies plain objects and objects created with Object.create(null) as object"],"goal":"verify pkg:npm/jest-get-type@29.6.3","kind":"HOW","packages":["pkg:npm/jest-get-type@29.6.3"],"schemaVersion":1,"symbols":["getType"]},"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/jest-get-type@29.6.3"],"schemaVersion":1,"subject":"pkg:npm/jest-get-type@29.6.3","symbols":["getType"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-jest-get-type",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-jest-get-type",
"version": "1.0.0",
"dependencies": {
"jest-get-type": "29.6.3"
}
},
"node_modules/jest-get-type": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz",
"integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==",
"license": "MIT",
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
}
}
}
{
"name": "sample-jest-get-type",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of jest-get-type",
"main": "src/index.js",
"dependencies": {
"jest-get-type": "29.6.3"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/jest-get-type@29.6.3",
"kind": "HOW",
"packages": [
"pkg:npm/jest-get-type@29.6.3"
],
"symbols": [
"getType"
]
}
'use strict';
const { getType, isPrimitive } = require('jest-get-type');
/**
* Returns the exact type string for any JavaScript value.
* @param {*} value
* @returns {string}
*/
function identifyType(value) {
return getType(value);
}
module.exports = {
getType,
isPrimitive,
identifyType
};
import assert from 'node:assert';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const { getType, isPrimitive, identifyType } = require('../src/index.js');
// 1. Export verification
assert.strictEqual(typeof getType, 'function', 'getType should be a function');
assert.strictEqual(typeof isPrimitive, 'function', 'isPrimitive should be a function');
assert.strictEqual(typeof identifyType, 'function', 'identifyType should be a function');
// 2. Primitive values
assert.strictEqual(getType(undefined), 'undefined', 'undefined should return "undefined"');
assert.strictEqual(getType(null), 'null', 'null should return "null"');
assert.strictEqual(getType(true), 'boolean', 'true should return "boolean"');
assert.strictEqual(getType(false), 'boolean', 'false should return "boolean"');
assert.strictEqual(getType(0), 'number', '0 should return "number"');
assert.strictEqual(getType(-42.5), 'number', '-42.5 should return "number"');
assert.strictEqual(getType(NaN), 'number', 'NaN should return "number"');
assert.strictEqual(getType(Infinity), 'number', 'Infinity should return "number"');
assert.strictEqual(getType(-Infinity), 'number', '-Infinity should return "number"');
assert.strictEqual(getType(0n), 'bigint', '0n should return "bigint"');
assert.strictEqual(getType(9007199254740991n), 'bigint', '9007199254740991n should return "bigint"');
assert.strictEqual(getType(''), 'string', 'empty string should return "string"');
assert.strictEqual(getType('jest-get-type'), 'string', 'string should return "string"');
assert.strictEqual(getType(Symbol('sym')), 'symbol', 'symbol should return "symbol"');
assert.strictEqual(getType(Symbol.iterator), 'symbol', 'well-known symbol should return "symbol"');
// 3. Built-in objects
assert.strictEqual(getType([]), 'array', '[] should return "array"');
assert.strictEqual(getType([1, 2, 3]), 'array', '[1, 2, 3] should return "array"');
assert.strictEqual(getType(new Array(5)), 'array', 'new Array() should return "array"');
assert.strictEqual(getType(/test/i), 'regexp', '/test/i should return "regexp"');
assert.strictEqual(getType(new RegExp('test')), 'regexp', 'new RegExp() should return "regexp"');
assert.strictEqual(getType(new Map()), 'map', 'new Map() should return "map"');
assert.strictEqual(getType(new Set()), 'set', 'new Set() should return "set"');
assert.strictEqual(getType(new Date()), 'date', 'new Date() should return "date"');
// 4. Functions and classes
function standardFunction() {}
const arrowFunction = () => {};
function* generatorFunction() {}
async function asyncFunction() {}
class SampleClass {}
assert.strictEqual(getType(standardFunction), 'function', 'standard function should return "function"');
assert.strictEqual(getType(arrowFunction), 'function', 'arrow function should return "function"');
assert.strictEqual(getType(generatorFunction), 'function', 'generator function should return "function"');
assert.strictEqual(getType(asyncFunction), 'function', 'async function should return "function"');
assert.strictEqual(getType(SampleClass), 'function', 'class constructor should return "function"');
// 5. Plain objects
assert.strictEqual(getType({}), 'object', '{} should return "object"');
assert.strictEqual(getType({ a: 1, b: 'test' }), 'object', 'object with properties should return "object"');
assert.strictEqual(getType(Object.create(null)), 'object', 'Object.create(null) should return "object"');
// 6. Wrapper function consistency
assert.strictEqual(identifyType('hello'), 'string');
assert.strictEqual(identifyType([1, 2]), 'array');
assert.strictEqual(identifyType(null), 'null');
// 7. isPrimitive helper checks
assert.strictEqual(isPrimitive(123), true);
assert.strictEqual(isPrimitive('text'), true);
assert.strictEqual(isPrimitive(null), true);
assert.strictEqual(isPrimitive(undefined), true);
assert.strictEqual(isPrimitive(Symbol('s')), true);
assert.strictEqual(isPrimitive(10n), true);
assert.strictEqual(isPrimitive({}), false);
assert.strictEqual(isPrimitive([]), false);
console.log('Contract tests passed successfully.');
오리진 시더
익명