mirror of
https://github.com/rikkaneko/paste.git
synced 2025-08-06 14:10:13 +01:00
Fix paste type conversion bug
Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
203a9e4982
commit
2d7ce3f1c4
1 changed files with 2 additions and 1 deletions
|
@ -8,7 +8,8 @@ export enum PasteType {
|
|||
}
|
||||
|
||||
export const PasteTypeStr = (p: PasteType): string | undefined => {
|
||||
return ['paste', 'link', 'large_paste', 'unknown'].at(p + 1);
|
||||
if (p <= 0 || p >= 4) return 'unknown';
|
||||
return ['paste', 'link', 'large_paste'].at(p - 1);
|
||||
};
|
||||
|
||||
export const PasteTypeFrom = (s: string): PasteType => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue