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

Function parseLocation

services/isbn/cbl.js:52–62  ·  view source on GitHub ↗

* Parse separated city and state strings into a full * location if both are valid and non-null. * * @param {string} city The city where the book was published. * @param {string} state The state where the book was published. * @returns The full location string.

(city, state)

Source from the content-addressed store, hash-verified

50 * @returns The full location string.
51 */
52function parseLocation(city, state) {
53 if (!city || !state) {
54 return null;
55 }
56
57 if (city.length === 0 || state.length === 0) {
58 return null;
59 }
60
61 return `${city}, ${state}`;
62}
63
64/**
65 * Search for book details into the CBL database.

Callers 1

searchInCblFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected