what3words / w3w-node-wrapper

Node wrapper for the What3Words API
https://docs.what3words.com/api/v3/
MIT License
44 stars 10 forks source link

Response is un-decoded JSON #35

Closed jamescrowley closed 2 years ago

jamescrowley commented 2 years ago

Using the latest version in a NodeJS context,

const convertTo3wa = ConvertTo3waClient.init('XYZ');
const what3wordsResponse = await convertTo3wa.run({ coordinates: { lat: 34, lng: 0.22 } });

what3wordsResponse is in fact a string of JSON, and not the type suggested by TypeScript (LocationGeoJsonResponse | LocationJsonResponse).

I'm guessing perhaps one transport mechanism automatically decodes and the other doesn't?