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 33570a8030
commit 2675ff8f16
14 changed files with 2945 additions and 18 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;