* Parse the Google Books price format into a proper object. * * @param {object} saleInfo The Google Books price. * @returns The price object.
(saleInfo)
| 30 | * @returns The price object. |
| 31 | */ |
| 32 | function parsePrice(saleInfo) { |
| 33 | if (!saleInfo || saleInfo.saleability === 'NOT_FOR_SALE') { |
| 34 | return null; |
| 35 | } |
| 36 | |
| 37 | return { |
| 38 | currency: saleInfo.retailPrice.currencyCode, |
| 39 | amount: saleInfo.retailPrice.amount, |
| 40 | }; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Search for book details into the Google Books database. |
no outgoing calls
no test coverage detected