mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-24 23:07:11 -05:00
Consolidate festival ID parsing functions
This commit is contained in:
parent
3646814415
commit
9719317a53
|
|
@ -48,3 +48,11 @@ export function deriveId(node) {
|
|||
...node,
|
||||
};
|
||||
}
|
||||
|
||||
export function getFestId(id) {
|
||||
return Buffer.from(id, 'base64').toString().match(/^Fest-[A-Z]+:(.+)$/)?.[1] ?? id;
|
||||
}
|
||||
|
||||
export function getFestTeamId(id) {
|
||||
return Buffer.from(id, 'base64').toString().match(/^FestTeam-[A-Z]+:((.+):(.+))$/)?.[1] ?? id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,7 @@
|
|||
import fs from 'fs/promises';
|
||||
import prefixedConsole from "../../common/prefixedConsole.mjs";
|
||||
import DataUpdater from "./DataUpdater.mjs";
|
||||
|
||||
function getFestId(id) {
|
||||
return Buffer.from(id, 'base64').toString().match(/^Fest-[A-Z]+:(.+)$/)?.[1] ?? id;
|
||||
}
|
||||
|
||||
function getFestTeamId(id) {
|
||||
return Buffer.from(id, 'base64').toString().match(/^FestTeam-[A-Z]+:((.+):(.+))$/)?.[1] ?? id;
|
||||
}
|
||||
import { getFestId, getFestTeamId } from '../../common/util.mjs';
|
||||
|
||||
export default class FestivalRankingUpdater extends DataUpdater
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
import fs from 'fs/promises';
|
||||
import DataUpdater from "./DataUpdater.mjs";
|
||||
import FestivalRankingUpdater from './FestivalRankingUpdater.mjs';
|
||||
|
||||
function getFestId(id) {
|
||||
return Buffer.from(id, 'base64').toString().match(/^Fest-[A-Z]+:(.+)$/)?.[1] ?? id;
|
||||
}
|
||||
import { getFestId } from '../../common/util.mjs';
|
||||
|
||||
function generateFestUrl(id) {
|
||||
return process.env.DEBUG ?
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user