mirror of
https://github.com/Burn-E99/GroupUp.git
synced 2026-06-04 00:43:49 -04:00
sonar cleanup
This commit is contained in:
@@ -11,7 +11,7 @@ const tzOverrides: Array<Array<string>> = [
|
||||
['PST', '-08:00'],
|
||||
['IST', '+05:30'],
|
||||
];
|
||||
const abbrOverrides: Array<string> = tzOverrides.map(tzSet => tzSet[0]);
|
||||
const abbrOverrides: Array<string> = tzOverrides.map((tzSet) => tzSet[0]);
|
||||
|
||||
// Prefill the map
|
||||
for (const override of tzOverrides) {
|
||||
@@ -22,11 +22,9 @@ for (const override of tzOverrides) {
|
||||
const attemptAdd = (tzAbbr: string, tzOffset: string) => {
|
||||
if (!abbrOverrides.includes(tzAbbr)) {
|
||||
if (tzMap.has(tzAbbr) && tzMap.get(tzAbbr) !== tzOffset) {
|
||||
console.error(`DOUBLED TZ ABBR WITH DIFF OFFSETS: ${tzAbbr} | ${tzOffset} | ${tzMap.get(tzAbbr)}`)
|
||||
} else {
|
||||
if (!tzAbbr.includes('+') && !tzAbbr.includes('-')) {
|
||||
tzMap.set(tzAbbr, tzOffset);
|
||||
}
|
||||
console.error(`DOUBLED TZ ABBR WITH DIFF OFFSETS: ${tzAbbr} | ${tzOffset} | ${tzMap.get(tzAbbr)}`);
|
||||
} else if (!tzAbbr.includes('+') && !tzAbbr.includes('-')) {
|
||||
tzMap.set(tzAbbr, tzOffset);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -34,10 +32,10 @@ const attemptAdd = (tzAbbr: string, tzOffset: string) => {
|
||||
// Get each TZ from the csv
|
||||
for (const row of csvRows) {
|
||||
const [rawSTDOffset, rawDSTOffset, rawSTDAbbr, rawDSTAbbr] = row.replaceAll('?', '-').toUpperCase().split(',');
|
||||
const STDOffset = (rawSTDOffset || '');
|
||||
const DSTOffset = (rawDSTOffset || '');
|
||||
const STDAbbr = (rawSTDAbbr || '');
|
||||
const DSTAbbr = (rawDSTAbbr || '');
|
||||
const STDOffset = rawSTDOffset || '';
|
||||
const DSTOffset = rawDSTOffset || '';
|
||||
const STDAbbr = rawSTDAbbr || '';
|
||||
const DSTAbbr = rawDSTAbbr || '';
|
||||
|
||||
attemptAdd(STDAbbr, STDOffset);
|
||||
if (STDAbbr !== DSTAbbr) {
|
||||
@@ -47,7 +45,7 @@ for (const row of csvRows) {
|
||||
|
||||
// Log it out to copy to source
|
||||
const tzIt = tzMap.entries();
|
||||
let tzVal = tzIt.next()
|
||||
let tzVal = tzIt.next();
|
||||
while (!tzVal.done) {
|
||||
if (tzVal.value[0]) {
|
||||
console.log(`['${tzVal.value[0]}','${tzVal.value[1]}'],`);
|
||||
|
||||
Reference in New Issue
Block a user