Basic Jellyseerr discover page

This commit is contained in:
herrrta
2024-12-29 10:07:46 -05:00
parent c6b58c5c28
commit cbce83e109
8 changed files with 346 additions and 162 deletions

View File

@@ -1,2 +1,3 @@
export * from "./mmkv";
export * from "./number";
export * from "./mmkv";
export * from "./string";

View File

@@ -1,6 +1,9 @@
declare global {
interface Number {
bytesToReadable(): string;
secondsToMilliseconds(): number
minutesToMilliseconds(): number
hoursToMilliseconds(): number
}
}
@@ -19,4 +22,16 @@ Number.prototype.bytesToReadable = function () {
return `${bytes.toFixed(2)} B`;
}
Number.prototype.secondsToMilliseconds = function () {
return this.valueOf() * 1000
}
Number.prototype.minutesToMilliseconds = function () {
return this.valueOf() * (60).secondsToMilliseconds()
}
Number.prototype.hoursToMilliseconds = function () {
return this.valueOf() * (60).minutesToMilliseconds()
}
export {};

16
augmentations/string.ts Normal file
View File

@@ -0,0 +1,16 @@
declare global {
interface String {
toTitle(): string;
}
}
String.prototype.toTitle = function () {
return this
.replaceAll("_", " ")
.replace(
/\w\S*/g,
text => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase()
);
}
export {};