Beispiel
react-is 19.2.8: isSuspense
Verifiziertes Beispiel für npm react-is 19.2.8: isSuspense. Der Vertrag lief auf node 22 · linux debian/x64 · docker und bestand.
sha256:0c371ffb11fd8cf489b1ac1a7b32eed11b33349edf8f7e809caa084d32c5f439
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| 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-06 |
Fall
HOW- Ziel
- verify react-is.isSuspense in pkg:npm/react-is@19.2.8
- Pakete
- Symbole
-
- react-is.isSuspense
- Umgebung
- node 22.23.2
- Erstellt
- 2026-09-06T20:23:29Z
Contract
- isSuspense returns true for valid React 19 Suspense elements with Symbol.for('react.transitional.element')
- isSuspense returns false for standard DOM element objects and Fragment elements
- isSuspense returns false for plain objects, null, undefined, and primitives
- isSuspense returns false for the raw Suspense symbol when not wrapped in an element
- isSuspense returns false for legacy React 18 element objects using Symbol.for('react.element')
- typeOf returns Suspense symbol for valid React 19 Suspense elements
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.mjs
Quelltext
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 react-is.isSuspense in pkg:npm/react-is@19.2.8
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/react-is@19.2.8
Demonstrate these symbols/APIs:
- react-is.isSuspense
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:c084f41bafec3a66cb0be76bb36e84d8b1ab027e355f663373f8dc07eedf3ff2","constraints":{"executionContext":"node"},"contract":["isSuspense returns true for valid React 19 Suspense elements with Symbol.for('react.transitional.element')","isSuspense returns false for standard DOM element objects and Fragment elements","isSuspense returns false for plain objects, null, undefined, and primitives","isSuspense returns false for the raw Suspense symbol when not wrapped in an element","isSuspense returns false for legacy React 18 element objects using Symbol.for('react.element')","typeOf returns Suspense symbol for valid React 19 Suspense elements"],"goal":"verify react-is.isSuspense in pkg:npm/react-is@19.2.8","kind":"HOW","packages":["pkg:npm/react-is@19.2.8"],"schemaVersion":1,"symbols":["react-is.isSuspense"]},"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/react-is@19.2.8"],"schemaVersion":1,"subject":"pkg:npm/react-is@19.2.8","symbols":["react-is.isSuspense"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-react-is-suspense",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-react-is-suspense",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"react-is": "19.2.8"
}
},
"node_modules/react-is": {
"version": "19.2.8",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.8.tgz",
"integrity": "sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==",
"license": "MIT"
}
}
}
{
"name": "sample-react-is-suspense",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of react-is.isSuspense in react-is 19.2.8",
"main": "src/index.js",
"license": "MIT-0",
"dependencies": {
"react-is": "19.2.8"
}
}
{
"schemaVersion": 1,
"goal": "verify react-is.isSuspense in pkg:npm/react-is@19.2.8",
"kind": "HOW",
"packages": [
"pkg:npm/react-is@19.2.8"
],
"symbols": [
"react-is.isSuspense"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
'use strict';
const reactIs = require('react-is');
/**
* Check if the given value is a valid React Suspense element.
*
* @param {*} value - The value to check.
* @returns {boolean} True if the value is a Suspense element.
*/
function checkIsSuspense(value) {
return reactIs.isSuspense(value);
}
/**
* Get the element type symbol of a value using typeOf.
*
* @param {*} value - The value to inspect.
* @returns {symbol|undefined} The React element type symbol or undefined.
*/
function identifyTypeOf(value) {
return reactIs.typeOf(value);
}
exports.checkIsSuspense = checkIsSuspense;
exports.identifyTypeOf = identifyTypeOf;
exports.isSuspense = reactIs.isSuspense;
exports.Suspense = reactIs.Suspense;
exports.Element = reactIs.Element;
exports.typeOf = reactIs.typeOf;
import assert from 'node:assert/strict';
import {
checkIsSuspense,
identifyTypeOf,
isSuspense,
Suspense,
Element,
typeOf,
} from '../src/index.js';
// 1. Export types verification
assert.equal(typeof isSuspense, 'function', 'isSuspense must be exported as a function');
assert.equal(typeof checkIsSuspense, 'function', 'checkIsSuspense helper must be a function');
assert.equal(typeof identifyTypeOf, 'function', 'identifyTypeOf helper must be a function');
assert.equal(typeof typeOf, 'function', 'typeOf must be exported as a function');
assert.equal(typeof Suspense, 'symbol', 'Suspense must be exported as a symbol');
assert.equal(typeof Element, 'symbol', 'Element must be exported as a symbol');
assert.equal(Suspense, Symbol.for('react.suspense'), 'Suspense symbol must match react.suspense');
assert.equal(Element, Symbol.for('react.transitional.element'), 'Element symbol must match react.transitional.element');
// 2. React 19 Suspense element detection
const suspenseElement = {
$$typeof: Element,
type: Suspense,
props: { fallback: null, children: [] },
key: null,
ref: null,
};
assert.equal(isSuspense(suspenseElement), true, 'isSuspense must return true for valid React 19 Suspense element');
assert.equal(checkIsSuspense(suspenseElement), true, 'checkIsSuspense helper must return true for valid Suspense element');
// 3. Non-Suspense element rejection
const plainElement = {
$$typeof: Element,
type: 'div',
props: { className: 'container' },
key: null,
ref: null,
};
const fragmentElement = {
$$typeof: Element,
type: Symbol.for('react.fragment'),
props: {},
key: null,
ref: null,
};
assert.equal(isSuspense(plainElement), false, 'isSuspense must return false for standard DOM element');
assert.equal(checkIsSuspense(plainElement), false, 'checkIsSuspense must return false for standard DOM element');
assert.equal(isSuspense(fragmentElement), false, 'isSuspense must return false for Fragment element');
// 4. Non-element and primitive values rejection
assert.equal(isSuspense({}), false, 'isSuspense must return false for plain empty object');
assert.equal(isSuspense(null), false, 'isSuspense must return false for null');
assert.equal(isSuspense(undefined), false, 'isSuspense must return false for undefined');
assert.equal(isSuspense('suspense'), false, 'isSuspense must return false for string');
assert.equal(isSuspense(123), false, 'isSuspense must return false for number');
assert.equal(isSuspense(true), false, 'isSuspense must return false for boolean');
assert.equal(isSuspense(Symbol.for('react.suspense')), false, 'isSuspense must return false for raw Symbol without element envelope');
assert.equal(isSuspense(Suspense), false, 'isSuspense must return false for exported Suspense symbol');
// 5. Legacy React 18 element rejection
const legacySuspenseElement = {
$$typeof: Symbol.for('react.element'),
type: Suspense,
props: { fallback: null, children: [] },
key: null,
ref: null,
};
assert.equal(isSuspense(legacySuspenseElement), false, 'isSuspense must return false for legacy React 18 element');
// 6. Element type identification
assert.equal(typeOf(suspenseElement), Suspense, 'typeOf must return Suspense symbol for Suspense element');
assert.equal(identifyTypeOf(suspenseElement), Suspense, 'identifyTypeOf helper must return Suspense symbol');
assert.notEqual(typeOf(plainElement), Suspense, 'typeOf for plainElement must not equal Suspense symbol');
assert.equal(typeOf({}), undefined, 'typeOf on non-element must return undefined');
assert.equal(typeOf(null), undefined, 'typeOf on null must return undefined');
console.log('All contract assertions for react-is.isSuspense in react-is@19.2.8 passed.');
Ursprungs-Seeder
anonym