Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
33
frontend/node_modules/recharts/lib/util/getEveryNth.js
generated
vendored
Normal file
33
frontend/node_modules/recharts/lib/util/getEveryNth.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getEveryNth = getEveryNth;
|
||||
/**
|
||||
* Given an array and a number N, return a new array which contains every nTh
|
||||
* element of the input array. For n below 1, an empty array is returned.
|
||||
* For n equal to 1, the input array is returned as is.
|
||||
* For n greater than the length of the array, an array containing the first element
|
||||
* and every nTh element after that (if any) is returned.
|
||||
*
|
||||
* @param array An input array.
|
||||
* @param n A number specifying which elements to take.
|
||||
* @returns The result array of the same type as the input array.
|
||||
*/
|
||||
function getEveryNth(array, n) {
|
||||
if (n < 1) {
|
||||
return [];
|
||||
}
|
||||
if (n === 1) {
|
||||
return array;
|
||||
}
|
||||
var result = [];
|
||||
for (var i = 0; i < array.length; i += n) {
|
||||
var item = array[i];
|
||||
if (item !== undefined) {
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue