pre-load wfo point info for regional and travel cities

This commit is contained in:
Matt Walsh
2022-11-22 14:17:04 -06:00
parent 6e2abf6720
commit c28608bb39
13 changed files with 2940 additions and 11 deletions

22
datagenerators/chunk.js Normal file
View File

@@ -0,0 +1,22 @@
// turn a long array into a set of smaller chunks
const chunk = (data, chunkSize = 10) => {
const chunks = [];
let thisChunk = [];
data.forEach((d) => {
if (thisChunk.length >= chunkSize) {
chunks.push(thisChunk);
thisChunk = [];
}
thisChunk.push(d);
});
// final chunk
if (thisChunk.length > 0) chunks.push(thisChunk);
return chunks;
};
module.exports = chunk;