( label: string, properties: T, schemaProperties: ElementSchema["properties"] | undefined, )
| 90 | * @returns A new object with all transformed/validated values |
| 91 | */ |
| 92 | export function parseProperties<T extends Record<string, unknown>>( |
| 93 | label: string, |
| 94 | properties: T, |
| 95 | schemaProperties: ElementSchema["properties"] | undefined, |
| 96 | ): T { |
| 97 | if (!schemaProperties) { |
| 98 | return properties; |
| 99 | } |
| 100 | |
| 101 | const result: Record<string, unknown> = {}; |
| 102 | for (const key of Object.keys(properties)) { |
| 103 | result[key] = parsePropertyValue(key, label, properties[key], schemaProperties); |
| 104 | } |
| 105 | return result as T; |
| 106 | } |
| 107 | |
| 108 | const customInspectSymbol = Symbol.for("nodejs.util.inspect.custom"); |
| 109 |
no test coverage detected