aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-10-17 17:39:35 -0700
committerFuwn <[email protected]>2023-10-17 17:39:35 -0700
commitc7c0ebca09b49cd73ffe34d255ff7a5a125f9013 (patch)
tree6f209c9318ed52df5ef116311a1a6e808c84af7c
parentfeat: initial release (diff)
downloadshinobu-c7c0ebca09b49cd73ffe34d255ff7a5a125f9013.tar.xz
shinobu-c7c0ebca09b49cd73ffe34d255ff7a5a125f9013.zip
feat(worker): condense
-rw-r--r--src/worker.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/worker.ts b/src/worker.ts
index d470b5f..124c67b 100644
--- a/src/worker.ts
+++ b/src/worker.ts
@@ -8,14 +8,15 @@ const shinobu = async (): Promise<Blob> => {
// return cache["shinobu"].blob;
// }
- const url = (
- (await (await fetch(`https://api.waifu.pics/sfw/shinobu`)).json()) as {
- url: string;
- }
- ).url;
-
- const response = await fetch(url);
- const blob = await response.blob();
+ const blob = await (
+ await fetch(
+ (
+ (await (await fetch(`https://api.waifu.pics/sfw/shinobu`)).json()) as {
+ url: string;
+ }
+ ).url
+ )
+ ).blob();
// cache["shinobu"] = {
// blob,