Exemplo
@vitest/expect 2.1.9: isA
Amostra verificada para npm @vitest/expect 2.1.9: isA. O contrato rodou em node 22 · linux debian/x64 · docker e passou: isA verifies primitive types…
sha256:e6c5c6a46aef742e34585a6b444cde03ca24d8b0b0432377de8d106d590248c4
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
node linux 24 · ubuntu · glibc 2.39 x64 node npm
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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-04 |
Caso
HOW- Objetivo
- verify @vitest/expect.isA in pkg:npm/%40vitest/expect@2.1.9
- Pacotes
- Símbolos
-
- @vitest/expect.isA
- Ambiente
- node
- Criado
- 2026-09-04T04:00:21Z
Contrato
- isA verifies primitive types including string, number, boolean, null, and undefined against their typeName tags
- isA accurately identifies built-in structures including Object, Array, Date, RegExp, and Promise
- isA detects standard collection instances such as Map, Set, WeakMap, and WeakSet
- isA distinguishes function forms including standard functions, async functions, and generator functions
- isA recognizes custom types tagged via Symbol.toStringTag
- isA returns false when the given typeName does not match the value's internal type tag
Arquivos
- PROMPT.md
- csx.json
- index.js
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código-fonte
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 @vitest/expect.isA in pkg:npm/%40vitest/expect@2.1.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40vitest/expect@2.1.9
Demonstrate these symbols/APIs:
- @vitest/expect.isA
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:bf1c7e1377c17ef942994d7a4e35a71254780b372edaa89f2583f980dad53fed","contract":["isA verifies primitive types including string, number, boolean, null, and undefined against their typeName tags","isA accurately identifies built-in structures including Object, Array, Date, RegExp, and Promise","isA detects standard collection instances such as Map, Set, WeakMap, and WeakSet","isA distinguishes function forms including standard functions, async functions, and generator functions","isA recognizes custom types tagged via Symbol.toStringTag","isA returns false when the given typeName does not match the value's internal type tag"],"goal":"verify @vitest/expect.isA in pkg:npm/%40vitest/expect@2.1.9","kind":"HOW","packages":["pkg:npm/%40vitest/expect@2.1.9"],"schemaVersion":1,"symbols":["@vitest/expect.isA"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","runtime":"node","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40vitest/expect@2.1.9"],"schemaVersion":1,"subject":"pkg:npm/%40vitest/expect@2.1.9","symbols":["@vitest/expect.isA"],"verifierAdapter":"node-typescript@1"}
import { isA } from '@vitest/expect';
/**
* Checks whether a given value matches the expected type name tag.
*
* @param {string} typeName - Expected internal [[Class]] tag, e.g. "String", "Array", "Map".
* @param {unknown} value - Target value to inspect.
* @returns {boolean} True if the value's string representation matches "[object <typeName>]".
*/
export function checkType(typeName, value) {
return isA(typeName, value);
}
export { isA };
{
"name": "sample-vitest-expect-is-a",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-vitest-expect-is-a",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@vitest/expect": "2.1.9"
}
},
"node_modules/@vitest/expect": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz",
"integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==",
"license": "MIT",
"dependencies": {
"@vitest/spy": "2.1.9",
"@vitest/utils": "2.1.9",
"chai": "^5.1.2",
"tinyrainbow": "^1.2.0"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/pretty-format": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz",
"integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==",
"license": "MIT",
"dependencies": {
"tinyrainbow": "^1.2.0"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/spy": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz",
"integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==",
"license": "MIT",
"dependencies": {
"tinyspy": "^3.0.2"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/@vitest/utils": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz",
"integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==",
"license": "MIT",
"dependencies": {
"@vitest/pretty-format": "2.1.9",
"loupe": "^3.1.2",
"tinyrainbow": "^1.2.0"
},
"funding": {
"url": "https://opencollective.com/vitest"
}
},
"node_modules/assertion-error": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
"integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
"license": "MIT",
"engines": {
"node": ">=12"
}
},
"node_modules/chai": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
"integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
"license": "MIT",
"dependencies": {
"assertion-error": "^2.0.1",
"check-error": "^2.1.1",
"deep-eql": "^5.0.1",
"loupe": "^3.1.0",
"pathval": "^2.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/check-error": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
"integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
"license": "MIT",
"engines": {
"node": ">= 16"
}
},
"node_modules/deep-eql": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
"integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/loupe": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
"integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
"license": "MIT"
},
"node_modules/pathval": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
"integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
"license": "MIT",
"engines": {
"node": ">= 14.16"
}
},
"node_modules/tinyrainbow": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz",
"integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/tinyspy": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz",
"integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
}
}
}
{
"name": "sample-vitest-expect-is-a",
"version": "1.0.0",
"description": "Clean-room sample verifying @vitest/expect.isA",
"license": "MIT-0",
"type": "module",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"@vitest/expect": "2.1.9"
}
}
{
"schemaVersion": 1,
"goal": "verify @vitest/expect.isA in pkg:npm/%40vitest/expect@2.1.9",
"kind": "HOW",
"packages": [
"pkg:npm/%40vitest/expect@2.1.9"
],
"symbols": [
"@vitest/expect.isA"
]
}
import assert from 'node:assert/strict';
import { isA } from '@vitest/expect';
import { checkType } from '../index.js';
// 1. Primitive types verification
assert.equal(isA('String', 'hello world'), true);
assert.equal(isA('String', ''), true);
assert.equal(isA('Number', 42), true);
assert.equal(isA('Number', 0), true);
assert.equal(isA('Number', NaN), true);
assert.equal(isA('Number', Infinity), true);
assert.equal(isA('Boolean', true), true);
assert.equal(isA('Boolean', false), true);
assert.equal(isA('Undefined', undefined), true);
assert.equal(isA('Null', null), true);
assert.equal(isA('Symbol', Symbol('sym')), true);
assert.equal(isA('BigInt', 9007199254740991n), true);
// 2. Built-in object structures
assert.equal(isA('Array', [1, 2, 3]), true);
assert.equal(isA('Array', []), true);
assert.equal(isA('Object', { key: 'value' }), true);
assert.equal(isA('Object', {}), true);
assert.equal(isA('Date', new Date()), true);
assert.equal(isA('RegExp', /abc/i), true);
assert.equal(isA('Promise', Promise.resolve(1)), true);
assert.equal(isA('Error', new Error('test err')), true);
// 3. Collection instances
assert.equal(isA('Map', new Map()), true);
assert.equal(isA('Set', new Set()), true);
assert.equal(isA('WeakMap', new WeakMap()), true);
assert.equal(isA('WeakSet', new WeakSet()), true);
// 4. Function variants
assert.equal(isA('Function', function named() {}), true);
assert.equal(isA('Function', () => {}), true);
assert.equal(isA('AsyncFunction', async () => {}), true);
assert.equal(isA('GeneratorFunction', function* () {}), true);
// 5. Custom Symbol.toStringTag
const customTagged = { [Symbol.toStringTag]: 'CustomTag' };
assert.equal(isA('CustomTag', customTagged), true);
assert.equal(checkType('CustomTag', customTagged), true);
// 6. Negative assertions / type discrimination
assert.equal(isA('Array', { 0: 'a', length: 1 }), false);
assert.equal(isA('Object', [1, 2, 3]), false);
assert.equal(isA('Number', '42'), false);
assert.equal(isA('String', 42), false);
assert.equal(isA('Function', {}), false);
assert.equal(isA('AsyncFunction', function () {}), false);
console.log('All contract assertions passed.');
Seeder de origem
anônimo