Exemple
is-arrayish 0.2.1: isArrayish
Échantillon vérifié pour npm is-arrayish 0.2.1: isArrayish. Le contrat s'est exécuté sur node 22 · linux alpine/x64 · docker et a réussi.
sha256:b52e48c0d23e187cf39bf53b557644ef7189c5f6bac340b6103a4de55019936c
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 2
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
| 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-07 |
Cas
HOW- Objectif
- verify isArrayish in pkg:npm/is-arrayish@0.2.1
- Paquets
- Symboles
-
- isArrayish
- Environnement
- node 22.23.2
- Créé
- 2026-08-26T00:58:20Z
Contrat
- isArrayish returns true for standard array literals and Array instances
- isArrayish returns true for objects with a non-negative length property and a splice function
- isArrayish returns false for null, undefined, and falsy primitives
- isArrayish returns false for plain objects without length or splice methods
- isArrayish returns false for strings and primitive values
- isArrayish returns false for objects where length is negative or splice is not a function
Fichiers
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Code source
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 isArrayish in pkg:npm/is-arrayish@0.2.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/is-arrayish@0.2.1
Demonstrate these symbols/APIs:
- isArrayish
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:20beb4625af8af4843a41a8f38dc5aa40b9d8123e6bb9979c89fc34af7f5af1f","constraints":{"executionContext":"node"},"contract":["isArrayish returns true for standard array literals and Array instances","isArrayish returns true for objects with a non-negative length property and a splice function","isArrayish returns false for null, undefined, and falsy primitives","isArrayish returns false for plain objects without length or splice methods","isArrayish returns false for strings and primitive values","isArrayish returns false for objects where length is negative or splice is not a function"],"goal":"verify isArrayish in pkg:npm/is-arrayish@0.2.1","kind":"HOW","packages":["pkg:npm/is-arrayish@0.2.1"],"schemaVersion":1,"symbols":["isArrayish"]},"contractCommand":["node","test/contract.mjs"],"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/is-arrayish@0.2.1"],"schemaVersion":1,"subject":"pkg:npm/is-arrayish@0.2.1","symbols":["isArrayish"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-is-arrayish",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-is-arrayish",
"version": "1.0.0",
"dependencies": {
"is-arrayish": "0.2.1"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
"license": "MIT"
}
}
}
{
"name": "sample-is-arrayish",
"version": "1.0.0",
"type": "module",
"private": true,
"dependencies": {
"is-arrayish": "0.2.1"
}
}
{
"schemaVersion": 1,
"goal": "verify isArrayish in pkg:npm/is-arrayish@0.2.1",
"kind": "HOW",
"packages": [
"pkg:npm/is-arrayish@0.2.1"
],
"symbols": [
"isArrayish"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert from 'node:assert/strict';
import isArrayish from 'is-arrayish';
// 1. isArrayish returns true for standard array literals and Array instances
{
assert.equal(isArrayish([]), true);
assert.equal(isArrayish([1, 2, 3]), true);
assert.equal(isArrayish(new Array(5)), true);
}
// 2. isArrayish returns true for objects with a non-negative length property and a splice function
{
const customArrayish = {
length: 0,
splice: function () {},
};
assert.equal(isArrayish(customArrayish), true);
const populatedArrayish = {
0: 'hello',
1: 'world',
length: 2,
splice: Array.prototype.splice,
};
assert.equal(isArrayish(populatedArrayish), true);
}
// 3. isArrayish returns false for null, undefined, and falsy primitives
{
assert.equal(isArrayish(null), false);
assert.equal(isArrayish(undefined), false);
assert.equal(isArrayish(0), false);
assert.equal(isArrayish(''), false);
assert.equal(isArrayish(false), false);
assert.equal(isArrayish(NaN), false);
}
// 4. isArrayish returns false for plain objects without length or splice methods
{
assert.equal(isArrayish({}), false);
assert.equal(isArrayish({ a: 1, b: 2 }), false);
assert.equal(isArrayish({ length: 0 }), false);
assert.equal(isArrayish({ length: 5 }), false);
assert.equal(isArrayish({ splice: function () {} }), false);
}
// 5. isArrayish returns false for strings and primitive values
{
assert.equal(isArrayish('string'), false);
assert.equal(isArrayish(123), false);
assert.equal(isArrayish(true), false);
assert.equal(isArrayish(Symbol('test')), false);
assert.equal(isArrayish(BigInt(10)), false);
}
// 6. isArrayish returns false for objects where length is negative or splice is not a function
{
const negativeLength = {
length: -1,
splice: function () {},
};
assert.equal(isArrayish(negativeLength), false);
const nonFunctionSplice = {
length: 2,
splice: 'not a function',
};
assert.equal(isArrayish(nonFunctionSplice), false);
}
Seeder d'origine
anonyme