get rid of sheets frontend, use typescript, use ndjson
Some checks failed
Sheets Deploy Hook / notify (push) Has been cancelled
Some checks failed
Sheets Deploy Hook / notify (push) Has been cancelled
This commit is contained in:
parent
3fcc874852
commit
f5973ba5a0
59 changed files with 757 additions and 7830 deletions
57
lib.ts
Normal file
57
lib.ts
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
export const thIgnore = [
|
||||
"🎹Worst Comps & Edits",
|
||||
"🎹 Yedits",
|
||||
"🎹 Comps & Edits",
|
||||
"Comps & Edits",
|
||||
"Worst Comps & Edits",
|
||||
"Yedits",
|
||||
"K4$H K4$$!N0",
|
||||
"K4HKn0",
|
||||
"AI Models",
|
||||
"🎹 BPM & Key Tracker",
|
||||
"🎹Comps & Edits",
|
||||
"🎹 Worst Comps & Edits",
|
||||
"Allegations",
|
||||
"Rap Disses Timeline",
|
||||
"Underground Artists",
|
||||
"bpmkeytracker",
|
||||
]
|
||||
|
||||
export enum TripleBool {
|
||||
MOSTLY = 2,
|
||||
YES = 1,
|
||||
NO = 0
|
||||
}
|
||||
|
||||
const TripleBoolStrings: Record<TripleBool, string> = {
|
||||
[TripleBool.MOSTLY]: "Mostly",
|
||||
[TripleBool.YES]: "Yes",
|
||||
[TripleBool.NO]: "No",
|
||||
};
|
||||
|
||||
export function tripleBoolToString(v: TripleBool): string {
|
||||
return TripleBoolStrings[v];
|
||||
}
|
||||
|
||||
export function tripleBool(bool: string): TripleBool {
|
||||
if(bool.toLowerCase() == "mostly") {
|
||||
return TripleBool.MOSTLY;
|
||||
} else if(bool.toLowerCase() == "yes") {
|
||||
return TripleBool.YES
|
||||
} else if(bool.toLowerCase() == "no") {
|
||||
return TripleBool.NO
|
||||
}
|
||||
|
||||
throw new Error("tripleBool conversion function errored, mysteriously! Passed in: " + bool)
|
||||
}
|
||||
|
||||
|
||||
export function ndjsonToJson(ndjson: string): any[] {
|
||||
return ndjson.split("\n").map(z => {
|
||||
try {
|
||||
return JSON.parse(z)
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}).filter(Boolean);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue