* Parse the Mercado Editorial dimensions format into a proper object. * * @param {string} dimensions The Mercado Editorial dimensions. * @returns A object with width and height if valid.
(dimensions)
| 12 | * @returns A object with width and height if valid. |
| 13 | */ |
| 14 | function parseDimensions(dimensions) { |
| 15 | if (!dimensions) { |
| 16 | return null; |
| 17 | } |
| 18 | |
| 19 | return { |
| 20 | width: parseFloat(dimensions.largura), |
| 21 | height: parseFloat(dimensions.altura), |
| 22 | unit: 'CENTIMETER', |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Parse separated currency and price into a price object |
no outgoing calls
no test coverage detected