MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / parseDimensions

Function parseDimensions

services/isbn/mercadoEditorial.js:14–24  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

12 * @returns A object with width and height if valid.
13 */
14function 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

Callers 1

searchInMercadoEditorialFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected