Files
2026-07-26 18:25:37 +09:00

29 lines
695 B
JavaScript

export class VisibilityConverter {
static encode(v) {
switch(v){
case "public":
return v;
case "home":
return "unlisted";
case "followers":
return "private";
case "specified":
return "direct";
case "hidden":
throw new Error();
}
}
static decode(v) {
switch(v){
case "public":
return v;
case "unlisted":
return "home";
case "private":
return "followers";
case "direct":
return "specified";
}
}
}