MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / normalizeProps

Function normalizeProps

packages/jsx/src/createElement.ts:184–197  ·  view source on GitHub ↗
(
  props: Readonly<Record<string, unknown>> | null | undefined,
  key: string | undefined,
)

Source from the content-addressed store, hash-verified

182}
183
184function normalizeProps(
185 props: Readonly<Record<string, unknown>> | null | undefined,
186 key: string | undefined,
187): Record<string, unknown> {
188 if (props === null || props === undefined) {
189 return key === undefined ? {} : { key };
190 }
191
192 if (key === undefined) {
193 return { ...props };
194 }
195
196 return { ...props, key };
197}
198
199/**
200 * Create a Rezi VNode from JSX runtime inputs.

Callers 1

createElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected