サンプル
react-is 17.0.2: Element
検証済みサンプル — npm react-is 17.0.2: Element. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: Element is exported as a symbol matching…
sha256:4b11c2452775dd5ab22bbe3ad5735d1f0f43fc107a7ce74d79e77593c9b85b79
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。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-06 |
ケース
HOW- ゴール
- verify react-is.Element in pkg:npm/react-is@17.0.2
- パッケージ
- シンボル
-
- react-is.Element
- 作成日
- 2026-09-06T01:21:05Z
コントラクト
- Element is exported as a symbol matching Symbol.for('react.element')
- Element represents the $$typeof identifier used for React element objects
- isElement returns true for objects with $$typeof equal to Element
- typeOf returns Element for React element objects and distinguishes them from non-elements or other React types
ファイル
- 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 react-is.Element in pkg:npm/react-is@17.0.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/react-is@17.0.2
Demonstrate these symbols/APIs:
- react-is.Element
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:f6af33f3b7d763ad7ebf6636eca3798133ba741e7d78947a92440bc38367382b","contract":["Element is exported as a symbol matching Symbol.for('react.element')","Element represents the $$typeof identifier used for React element objects","isElement returns true for objects with $$typeof equal to Element","typeOf returns Element for React element objects and distinguishes them from non-elements or other React types"],"goal":"verify react-is.Element in pkg:npm/react-is@17.0.2","kind":"HOW","packages":["pkg:npm/react-is@17.0.2"],"schemaVersion":1,"symbols":["react-is.Element"]},"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/react-is@17.0.2"],"schemaVersion":1,"subject":"pkg:npm/react-is@17.0.2","symbols":["react-is.Element"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-react-is-element",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-react-is-element",
"version": "1.0.0",
"dependencies": {
"react-is": "17.0.2"
}
},
"node_modules/react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
"license": "MIT"
}
}
}
{
"name": "sample-react-is-element",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of react-is.Element in react-is 17.0.2",
"type": "module",
"main": "src/index.js",
"dependencies": {
"react-is": "17.0.2"
}
}
{
"schemaVersion": 1,
"goal": "verify react-is.Element in pkg:npm/react-is@17.0.2",
"kind": "HOW",
"packages": [
"pkg:npm/react-is@17.0.2"
],
"symbols": [
"react-is.Element"
]
}
import { Element, isElement, typeOf } from 'react-is';
/**
* Return the Element symbol exported by react-is.
*
* @returns {symbol} The React element identifier symbol.
*/
export function getElementSymbol() {
return Element;
}
/**
* Check if the provided symbol matches react-is Element.
*
* @param {*} sym - Symbol or value to compare.
* @returns {boolean} True if matching react-is Element.
*/
export function isMatchingElementSymbol(sym) {
return sym === Element;
}
/**
* Create a mock React element object tagged with the Element symbol.
*
* @param {string} type - Element component or tag name.
* @param {object} props - Element properties.
* @returns {object} Object with $$typeof set to Element.
*/
export function createElementDescriptor(type, props = {}) {
return {
$$typeof: Element,
type,
props,
key: null,
ref: null,
};
}
/**
* Verify whether an object is recognized as a React element.
*
* @param {*} value - The value to inspect.
* @returns {boolean} True if the value is a React element.
*/
export function checkIsElement(value) {
return isElement(value);
}
/**
* Identify whether the typeOf helper resolves the value to the Element symbol.
*
* @param {*} value - The value to inspect.
* @returns {boolean} True if typeOf(value) === Element.
*/
export function isElementTypeOf(value) {
return typeOf(value) === Element;
}
export { Element, isElement, typeOf };
import assert from 'node:assert/strict';
import {
Element,
isElement,
typeOf,
getElementSymbol,
isMatchingElementSymbol,
createElementDescriptor,
checkIsElement,
isElementTypeOf,
} from '../src/index.js';
// 1. Element export assertion
assert.equal(typeof Element, 'symbol', 'Element must be exported as a symbol');
assert.equal(Element, Symbol.for('react.element'), 'Element must equal Symbol.for("react.element")');
assert.equal(getElementSymbol(), Element, 'getElementSymbol helper must return Element');
assert.equal(isMatchingElementSymbol(Element), true, 'isMatchingElementSymbol must return true for Element');
assert.equal(isMatchingElementSymbol(Symbol.for('react.element')), true, 'isMatchingElementSymbol must return true for Symbol.for("react.element")');
assert.equal(isMatchingElementSymbol(Symbol.for('react.fragment')), false, 'isMatchingElementSymbol must return false for other symbols');
// 2. Element detection with isElement
const elementObj = createElementDescriptor('div', { id: 'test' });
assert.equal(elementObj.$$typeof, Element, 'Created descriptor must have $$typeof equal to Element');
assert.equal(isElement(elementObj), true, 'isElement must return true for object with $$typeof Element');
assert.equal(checkIsElement(elementObj), true, 'checkIsElement helper must return true');
const nonElementObj = { type: 'div', props: {} };
assert.equal(isElement(nonElementObj), false, 'Plain object must not be recognized as element');
assert.equal(checkIsElement(null), false, 'null must not be recognized as element');
assert.equal(checkIsElement(undefined), false, 'undefined must not be recognized as element');
// 3. typeOf identification matching Element
assert.equal(typeOf(elementObj), Element, 'typeOf must return Element for object with $$typeof Element');
assert.equal(isElementTypeOf(elementObj), true, 'isElementTypeOf helper must return true for element object');
assert.equal(typeOf(nonElementObj), undefined, 'typeOf must return undefined for plain object without $$typeof');
assert.equal(isElementTypeOf(nonElementObj), false, 'isElementTypeOf helper must return false for non-element');
// 4. Distinction from other React symbols
const fragmentObj = {
$$typeof: Symbol.for('react.fragment'),
type: Symbol.for('react.fragment'),
props: {},
key: null,
ref: null,
};
assert.notEqual(typeOf(fragmentObj), Element, 'typeOf for fragment must not equal Element');
assert.equal(isElementTypeOf(fragmentObj), false, 'isElementTypeOf helper must return false for fragment');
console.log('Contract passed: react-is.Element verified successfully.');
オリジンシーダー
匿名