Function
normalizeProps
(
props: Readonly<Record<string, unknown>> | null | undefined,
key: string | undefined,
)
Source from the content-addressed store, hash-verified
| 182 | } |
| 183 | |
| 184 | function 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. |
Tested by
no test coverage detected