Skip to content

Commit 8ac43bf

Browse files
committed
Remove availableExt
1 parent b6df6f5 commit 8ac43bf

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/main/index.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,13 @@ import { Watch, WatchV2, toWatchlistV2 } from "../watch-list";
142142

143143
const gyazoAccessToken = await configStore.get("gyazoAccessToken");
144144
if (typeof gyazoAccessToken === "string" && gyazoAccessToken !== "") {
145-
const availableExts = [
146-
".gif",
147-
".jpeg",
148-
".jpg",
149-
".png",
150-
".webp",
151-
152-
".pdf",
153-
] as const;
154-
type AvailableExt = (typeof availableExts)[number];
155-
156-
const load = async ({ ext, file }: { ext: AvailableExt; file: Buffer }) => {
145+
const load = async ({
146+
ext,
147+
file,
148+
}: {
149+
ext: ".gif" | ".jpeg" | ".jpg" | ".png" | ".webp" | ".pdf";
150+
file: Buffer;
151+
}) => {
157152
switch (ext) {
158153
case ".gif":
159154
case ".jpeg":
@@ -315,9 +310,6 @@ import { Watch, WatchV2, toWatchlistV2 } from "../watch-list";
315310
return;
316311
}
317312
}
318-
const availableExt: AvailableExt extends typeof ext
319-
? AvailableExt
320-
: never = ext;
321313

322314
const { mtimeMs, size } = await stat(watch.path);
323315
if (!size) {

0 commit comments

Comments
 (0)