shootismoke / common

Useful packages for manipulating air quality data.
https://shootismoke.app
GNU General Public License v3.0
2 stars 2 forks source link

Typescript when trying to use "raw" in convert package #486

Open hellos3b opened 3 years ago

hellos3b commented 3 years ago

I'm using data from PurpleAir json, and trying to convert raw 10 minute average PM2.5 value to the USA EPA AQI value

I used to use "raw" in the from parameter:

convert('pm25', 'raw', 'usaEpa', sensorStats.v1)

I just started refactoring some of my code, and am now getting an error: Argument of type '"raw"' is not assignable to parameter of type '"chnMep" | "usaEpa" | "µg/m³" | "ppm" | "particles/cm³" | "ppb"'.

I'm honestly not very versed in pollutants and AQI, I just found this package a while ago while googling how to calculate an AQI. Do you know which string value I should use for this ? Or is it a bug that "raw" doesn't work anymore

amaury1093 commented 3 years ago

Thanks for the issue!

I recently renamed "raw" to "µg/m³" here. In your case, a search & replace should do the trick.