Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, (err, res, data) => {
if (err || res.statusCode !== 200) {
return done(null, []);
}
data = Buffer.from(data, 'binary');
var iconv = new Iconv('windows-1251', 'utf-8');
data = iconv.convert(data).toString();
let stationRegexp = /air-today\/station\/(\w*)\//;
let stationId = stationRegexp.exec(link)[1];
formatData(data, stationId, (measurements) => {
return done(null, measurements);
});
});
};