(value, propDefinition, target)
| 157 | * @param {any} target - Optional target value to parse into (reuse). |
| 158 | */ |
| 159 | export function parseProperty (value, propDefinition, target) { |
| 160 | // Use default value if value is falsy. |
| 161 | if (value === undefined || value === null || value === '') { |
| 162 | value = propDefinition.default; |
| 163 | if (Array.isArray(value)) { value = value.slice(); } |
| 164 | } |
| 165 | // Invoke property type parser. |
| 166 | return propDefinition.parse(value, propDefinition.default, target); |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Serialize a group of properties. |
no outgoing calls
no test coverage detected