サンプル
type-detect 4.0.8: type-detect
検証済みサンプル — npm type-detect 4.0.8: type-detect. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: type-detect returns exact lowercase type names for…
sha256:0e13cb3cbded458027e8fbdbabf92fcb5a6ed61f74235a793614e1b6a62bc033
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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-02 |
ケース
HOW- ゴール
- verify type-detect in pkg:npm/type-detect@4.0.8
- パッケージ
- シンボル
-
- type-detect
- 作成日
- 2026-09-02T07:41:19Z
コントラクト
- type-detect returns exact lowercase type names for primitives including null, undefined, boolean, number, string, symbol, and bigint
- type-detect identifies standard built-in objects including Array, Object, Map, Set, WeakMap, WeakSet, Date, and RegExp
- type-detect returns function for standard functions, arrow functions, async functions, and generator functions
- type-detect identifies binary array structures including ArrayBuffer, DataView, and Uint8Array
- type-detect returns Error for Error instances and built-in error subclasses, and Promise for Promises
ファイル
- 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 type-detect in pkg:npm/type-detect@4.0.8
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/type-detect@4.0.8
Demonstrate these symbols/APIs:
- type-detect
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:7a34039c3df660e0fd0c722fcae77f7808b0a31377cb057ae78dcb5ec7598815","contract":["type-detect returns exact lowercase type names for primitives including null, undefined, boolean, number, string, symbol, and bigint","type-detect identifies standard built-in objects including Array, Object, Map, Set, WeakMap, WeakSet, Date, and RegExp","type-detect returns function for standard functions, arrow functions, async functions, and generator functions","type-detect identifies binary array structures including ArrayBuffer, DataView, and Uint8Array","type-detect returns Error for Error instances and built-in error subclasses, and Promise for Promises"],"goal":"verify type-detect in pkg:npm/type-detect@4.0.8","kind":"HOW","packages":["pkg:npm/type-detect@4.0.8"],"schemaVersion":1,"symbols":["type-detect"]},"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/type-detect@4.0.8"],"schemaVersion":1,"subject":"pkg:npm/type-detect@4.0.8","symbols":["type-detect"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-type-detect",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-type-detect",
"version": "1.0.0",
"dependencies": {
"type-detect": "4.0.8"
}
},
"node_modules/type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
"license": "MIT",
"engines": {
"node": ">=4"
}
}
}
}
{
"name": "sample-type-detect",
"version": "1.0.0",
"private": true,
"type": "module",
"dependencies": {
"type-detect": "4.0.8"
}
}
{
"schemaVersion": 1,
"goal": "verify type-detect in pkg:npm/type-detect@4.0.8",
"kind": "HOW",
"packages": [
"pkg:npm/type-detect@4.0.8"
],
"symbols": [
"type-detect"
]
}
import assert from 'node:assert/strict';
import type from 'type-detect';
// 1. type-detect returns exact lowercase type names for primitives including null, undefined, boolean, number, string, symbol, and bigint
assert.equal(type(null), 'null');
assert.equal(type(undefined), 'undefined');
assert.equal(type(true), 'boolean');
assert.equal(type(false), 'boolean');
assert.equal(type(0), 'number');
assert.equal(type(NaN), 'number');
assert.equal(type(Infinity), 'number');
assert.equal(type(''), 'string');
assert.equal(type('sample-string'), 'string');
assert.equal(type(Symbol('sample-symbol')), 'symbol');
assert.equal(type(10n), 'bigint');
// 2. type-detect identifies standard built-in objects including Array, Object, Map, Set, WeakMap, WeakSet, Date, and RegExp
assert.equal(type([]), 'Array');
assert.equal(type([1, 2, 3]), 'Array');
assert.equal(type({}), 'Object');
assert.equal(type({ key: 'val' }), 'Object');
assert.equal(type(new Map()), 'Map');
assert.equal(type(new Set()), 'Set');
assert.equal(type(new WeakMap()), 'WeakMap');
assert.equal(type(new WeakSet()), 'WeakSet');
assert.equal(type(new Date()), 'Date');
assert.equal(type(/^[a-z]+$/i), 'RegExp');
// 3. type-detect returns function for standard functions, arrow functions, async functions, and generator functions
assert.equal(type(function named() {}), 'function');
assert.equal(type(() => {}), 'function');
assert.equal(type(async () => {}), 'function');
assert.equal(type(function* gen() {}), 'function');
// 4. type-detect identifies binary array structures including ArrayBuffer, DataView, and Uint8Array
assert.equal(type(new ArrayBuffer(16)), 'ArrayBuffer');
assert.equal(type(new DataView(new ArrayBuffer(16))), 'DataView');
assert.equal(type(new Uint8Array(8)), 'Uint8Array');
assert.equal(type(new Int32Array(8)), 'Int32Array');
// 5. type-detect returns Error for Error instances and built-in error subclasses, and Promise for Promises
assert.equal(type(new Error('generic error')), 'Error');
assert.equal(type(new TypeError('type error')), 'Error');
assert.equal(type(new RangeError('range error')), 'Error');
assert.equal(type(Promise.resolve(42)), 'Promise');
console.log('Contract tests passed successfully.');
オリジンシーダー
匿名