feat: update this highly outdated app to use latest packages and custom configs (#1)

Reviewed-on: https://codeberg.org/nhcarrigan/tingle-bot/pulls/1
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
2024-09-26 19:46:33 +00:00
committed by Naomi the Technomancer
parent 1339b63378
commit 7c0bd7ad10
74 changed files with 6348 additions and 8905 deletions

View File

@ -1,21 +1,25 @@
import { inarikoSeasons } from "../../data/weather/regions/inarikoSeasons";
import { rudaniaSeasons } from "../../data/weather/regions/rudaniaSeasons";
import { vhintlSeasons } from "../../data/weather/regions/vhintlSeasons";
import { RegionName } from "../../interfaces/weather/names/RegionName";
import { Season } from "../../interfaces/weather/names/Season";
import { RegionRestriction } from "../../interfaces/weather/regions/RegionRestriction";
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { inarikoSeasons } from "../../data/weather/regions/inarikoSeasons.js";
import { rudaniaSeasons } from "../../data/weather/regions/rudaniaSeasons.js";
import { vhintlSeasons } from "../../data/weather/regions/vhintlSeasons.js";
import type { RegionName } from "../../interfaces/weather/names/regionName.js";
import type { Season } from "../../interfaces/weather/names/season.js";
import type { RegionRestriction } from "../../interfaces/weather/regions/regionRestriction.js";
/**
* Module to get the allowed weather for a region based on the season.
* Will throw an error if the data is not found.
*
* @param {RegionName} region The name of the region.
* @param {Season} season The season.
* @returns {RegionRestriction} The allowed weather for the region.
* @param region - The name of the region.
* @param season - The season the region is in.
* @returns The allowed weather for the region.
*/
export const getRegionRestrictions = (
region: RegionName,
season: Season
season: Season,
): RegionRestriction | null => {
let restrictions = null;
switch (region) {
@ -32,7 +36,13 @@ export const getRegionRestrictions = (
return null;
}
const seasonalRestriction = restrictions.find((el) => el.season === season);
if (restrictions === null) {
return null;
}
const seasonalRestriction = restrictions.find((element) => {
return element.season === season;
});
if (!seasonalRestriction) {
return null;