샘플
react-is 19.2.8: typeOf
검증된 샘플 — npm react-is 19.2.8: typeOf. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: typeOf identifies standard React DOM and component elements…
sha256:0e32432ee2e212e42bb8b4d5e429747bcc2310b1542eb7f6004d9f6992a53340
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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.typeOf in pkg:npm/react-is@19.2.8
- 패키지
- 심벌
-
- react-is.typeOf
- 환경
- node 22.23.2
- 생성일
- 2026-09-06T02:14:09Z
컨트랙트
- typeOf identifies standard React DOM and component elements returning Element symbol
- typeOf identifies React fragment elements returning Fragment symbol
- typeOf identifies React portal objects returning Portal symbol
- typeOf identifies ContextProvider elements returning ContextProvider symbol
- typeOf identifies ContextConsumer elements returning ContextConsumer symbol
- typeOf identifies ForwardRef component elements returning ForwardRef symbol
- typeOf identifies Lazy component elements returning Lazy symbol
- typeOf identifies Memo component elements returning Memo symbol
- typeOf identifies Profiler elements returning Profiler symbol
- typeOf identifies StrictMode elements returning StrictMode symbol
- typeOf identifies Suspense elements returning Suspense symbol
- typeOf identifies SuspenseList elements returning SuspenseList symbol
- typeOf returns undefined for plain objects, null, undefined, and primitive types
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.js
소스
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.typeOf 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.typeOf
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:18341b0e80f506e98dd54aa467abf71a091badf82d517a65e6a1472681887ea0","constraints":{"executionContext":"node"},"contract":["typeOf identifies standard React DOM and component elements returning Element symbol","typeOf identifies React fragment elements returning Fragment symbol","typeOf identifies React portal objects returning Portal symbol","typeOf identifies ContextProvider elements returning ContextProvider symbol","typeOf identifies ContextConsumer elements returning ContextConsumer symbol","typeOf identifies ForwardRef component elements returning ForwardRef symbol","typeOf identifies Lazy component elements returning Lazy symbol","typeOf identifies Memo component elements returning Memo symbol","typeOf identifies Profiler elements returning Profiler symbol","typeOf identifies StrictMode elements returning StrictMode symbol","typeOf identifies Suspense elements returning Suspense symbol","typeOf identifies SuspenseList elements returning SuspenseList symbol","typeOf returns undefined for plain objects, null, undefined, and primitive types"],"goal":"verify react-is.typeOf in pkg:npm/react-is@19.2.8","kind":"HOW","packages":["pkg:npm/react-is@19.2.8"],"schemaVersion":1,"symbols":["react-is.typeOf"]},"contractCommand":["node","test/contract.js"],"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.typeOf"],"verifierAdapter":"node-typescript@1"}
{
"name": "verify-react-is-typeof",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "verify-react-is-typeof",
"version": "1.0.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": "verify-react-is-typeof",
"version": "1.0.0",
"description": "verify react-is.typeOf in pkg:npm/react-is@19.2.8",
"main": "src/index.js",
"dependencies": {
"react-is": "19.2.8"
}
}
{
"schemaVersion": 1,
"goal": "verify react-is.typeOf in pkg:npm/react-is@19.2.8",
"kind": "HOW",
"packages": [
"pkg:npm/react-is@19.2.8"
],
"symbols": [
"react-is.typeOf"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
const {
typeOf,
ContextConsumer,
ContextProvider,
Element,
ForwardRef,
Fragment,
Lazy,
Memo,
Portal,
Profiler,
StrictMode,
Suspense,
SuspenseList,
} = require('react-is');
/**
* Inspects a value and returns its React element type symbol, or undefined if not a React element.
*
* @param {*} value - Value to inspect.
* @returns {symbol|undefined} The React symbol or undefined.
*/
function inspectTypeOf(value) {
return typeOf(value);
}
module.exports = {
typeOf,
inspectTypeOf,
ContextConsumer,
ContextProvider,
Element,
ForwardRef,
Fragment,
Lazy,
Memo,
Portal,
Profiler,
StrictMode,
Suspense,
SuspenseList,
};
const assert = require('node:assert/strict');
const {
typeOf,
inspectTypeOf,
ContextConsumer,
ContextProvider,
Element,
ForwardRef,
Fragment,
Lazy,
Memo,
Portal,
Profiler,
StrictMode,
Suspense,
SuspenseList,
} = require('../src/index.js');
// 1. Export verification
assert.equal(typeof typeOf, 'function', 'typeOf must be a function');
assert.equal(typeof inspectTypeOf, 'function', 'inspectTypeOf must be a function');
assert.equal(typeof Element, 'symbol', 'Element must be a symbol');
assert.equal(typeof Fragment, 'symbol', 'Fragment must be a symbol');
assert.equal(typeof Portal, 'symbol', 'Portal must be a symbol');
assert.equal(typeof ContextProvider, 'symbol', 'ContextProvider must be a symbol');
assert.equal(typeof ContextConsumer, 'symbol', 'ContextConsumer must be a symbol');
assert.equal(typeof ForwardRef, 'symbol', 'ForwardRef must be a symbol');
assert.equal(typeof Lazy, 'symbol', 'Lazy must be a symbol');
assert.equal(typeof Memo, 'symbol', 'Memo must be a symbol');
assert.equal(typeof Profiler, 'symbol', 'Profiler must be a symbol');
assert.equal(typeof StrictMode, 'symbol', 'StrictMode must be a symbol');
assert.equal(typeof Suspense, 'symbol', 'Suspense must be a symbol');
assert.equal(typeof SuspenseList, 'symbol', 'SuspenseList must be a symbol');
// React 19 symbols
const REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');
const REACT_PORTAL_TYPE = Symbol.for('react.portal');
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
const REACT_CONTEXT_TYPE = Symbol.for('react.context');
const REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
const REACT_MEMO_TYPE = Symbol.for('react.memo');
const REACT_PROFILER_TYPE = Symbol.for('react.profiler');
const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
// 2. Standard React elements
const domElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: 'div',
props: { id: 'root' },
key: null,
ref: null,
};
assert.equal(typeOf(domElement), Element, 'typeOf(domElement) must return Element symbol');
assert.equal(inspectTypeOf(domElement), Element, 'inspectTypeOf(domElement) must return Element symbol');
const fnComponentElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: function MyComponent() { return null; },
props: {},
key: null,
ref: null,
};
assert.equal(typeOf(fnComponentElement), Element, 'typeOf(fnComponentElement) must return Element symbol');
// 3. Fragment element
const fragmentElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: REACT_FRAGMENT_TYPE,
props: { children: [] },
key: null,
ref: null,
};
assert.equal(typeOf(fragmentElement), Fragment, 'typeOf(fragmentElement) must return Fragment symbol');
// 4. Portal object
const portalObject = {
$$typeof: REACT_PORTAL_TYPE,
key: null,
children: [],
containerInfo: {},
};
assert.equal(typeOf(portalObject), Portal, 'typeOf(portalObject) must return Portal symbol');
// 5. ContextProvider element
const providerElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: {
$$typeof: REACT_CONTEXT_TYPE,
_context: {},
},
props: { value: 'test' },
key: null,
ref: null,
};
assert.equal(typeOf(providerElement), ContextProvider, 'typeOf(providerElement) must return ContextProvider symbol');
// 6. ContextConsumer element
const consumerElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: {
$$typeof: REACT_CONSUMER_TYPE,
},
props: { children: () => null },
key: null,
ref: null,
};
assert.equal(typeOf(consumerElement), ContextConsumer, 'typeOf(consumerElement) must return ContextConsumer symbol');
// 7. ForwardRef element
const forwardRefElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: {
$$typeof: REACT_FORWARD_REF_TYPE,
render: (props, ref) => null,
},
props: {},
key: null,
ref: null,
};
assert.equal(typeOf(forwardRefElement), ForwardRef, 'typeOf(forwardRefElement) must return ForwardRef symbol');
// 8. Lazy component element
const lazyElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: {
$$typeof: REACT_LAZY_TYPE,
_payload: {},
_init: () => null,
},
props: {},
key: null,
ref: null,
};
assert.equal(typeOf(lazyElement), Lazy, 'typeOf(lazyElement) must return Lazy symbol');
// 9. Memo component element
const memoElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: {
$$typeof: REACT_MEMO_TYPE,
type: 'span',
compare: null,
},
props: {},
key: null,
ref: null,
};
assert.equal(typeOf(memoElement), Memo, 'typeOf(memoElement) must return Memo symbol');
// 10. Profiler element
const profilerElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: REACT_PROFILER_TYPE,
props: { id: 'app-profiler', onRender: () => {} },
key: null,
ref: null,
};
assert.equal(typeOf(profilerElement), Profiler, 'typeOf(profilerElement) must return Profiler symbol');
// 11. StrictMode element
const strictModeElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: REACT_STRICT_MODE_TYPE,
props: { children: [] },
key: null,
ref: null,
};
assert.equal(typeOf(strictModeElement), StrictMode, 'typeOf(strictModeElement) must return StrictMode symbol');
// 12. Suspense element
const suspenseElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: REACT_SUSPENSE_TYPE,
props: { fallback: null, children: [] },
key: null,
ref: null,
};
assert.equal(typeOf(suspenseElement), Suspense, 'typeOf(suspenseElement) must return Suspense symbol');
// 13. SuspenseList element
const suspenseListElement = {
$$typeof: REACT_ELEMENT_TYPE,
type: REACT_SUSPENSE_LIST_TYPE,
props: { children: [] },
key: null,
ref: null,
};
assert.equal(typeOf(suspenseListElement), SuspenseList, 'typeOf(suspenseListElement) must return SuspenseList symbol');
// 14. Non-element values return undefined
assert.equal(typeOf({}), undefined, 'typeOf on empty object must return undefined');
assert.equal(typeOf({ type: 'div' }), undefined, 'typeOf on object without $$typeof must return undefined');
assert.equal(typeOf(null), undefined, 'typeOf on null must return undefined');
assert.equal(typeOf(undefined), undefined, 'typeOf on undefined must return undefined');
assert.equal(typeOf('div'), undefined, 'typeOf on string primitive must return undefined');
assert.equal(typeOf(12345), undefined, 'typeOf on number primitive must return undefined');
assert.equal(typeOf(true), undefined, 'typeOf on boolean primitive must return undefined');
console.log('Contract test for react-is.typeOf in pkg:npm/react-is@19.2.8 passed.');
오리진 시더
익명