(propData, schema)
| 170 | * Serialize a group of properties. |
| 171 | */ |
| 172 | export function stringifyProperties (propData, schema) { |
| 173 | var propName; |
| 174 | var propDefinition; |
| 175 | var propValue; |
| 176 | var stringifiedData = {}; |
| 177 | var value; |
| 178 | |
| 179 | for (propName in propData) { |
| 180 | propDefinition = schema[propName]; |
| 181 | propValue = propData[propName]; |
| 182 | value = propValue; |
| 183 | if (typeof value === 'object') { |
| 184 | value = stringifyProperty(propValue, propDefinition); |
| 185 | if (!propDefinition) { warn('Unknown component property: ' + propName); } |
| 186 | } |
| 187 | if (value !== undefined) { |
| 188 | stringifiedData[propName] = value; |
| 189 | } |
| 190 | } |
| 191 | return stringifiedData; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Serialize a single property. |
no test coverage detected