nickginsberg / noaa-gfs-js

A lightweight library for pulling GFS (Global Forecasting System) weather data from NOAA, without any major 3rd party depencies.
MIT License
7 stars 0 forks source link

ReferenceError on strict mode #3

Closed Javi-int closed 3 months ago

Javi-int commented 3 months ago

Hi, thanks for this library is actually saving me some time; however, I noticed that this:

lat_start = Math.min(lat_start_input + 90, lat_end_input + 90);
lat_end = Math.max(lat_start_input + 90, lat_end_input + 90);
lon_start = Math.min((lon_start_input + 360) % 360, (lon_end_input + 360) % 360);
lon_end = Math.max((lon_start_input + 360) % 360, (lon_end_input + 360) % 360);

Is throwing ReferenceError: assignment to undeclared variable lat_start when using the library in strict mode, as this syntax is not allowed.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var

Thanks again for your time :)

nickginsberg commented 3 months ago

Ah! I see why that is, fix is easy enough--let me know if version 1.0.2 works better for you.

Javi-int commented 3 months ago

Yeah, that works, thanks!