chore(deps): update devdependencies (#2163)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
renovate[bot] 2023-07-03 01:11:13 +08:00 committed by GitHub
parent 676470bae2
commit 5f2dca1979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 812 additions and 656 deletions

View file

@ -3,7 +3,6 @@ import memory from 'unstorage/drivers/memory'
import kv from 'unstorage/drivers/cloudflare-kv-http'
import { $fetch } from 'ofetch'
import type { Storage } from 'unstorage'
import cached from '../cache-driver'
@ -16,7 +15,7 @@ import { driver } from '#storage-config'
import type { AppInfo } from '~/types'
import { APP_NAME } from '~/constants'
const storage = useStorage() as Storage
const storage = useStorage<AppInfo>()
if (driver === 'fs') {
const config = useRuntimeConfig()
@ -58,7 +57,7 @@ export async function getApp(origin: string, server: string) {
try {
if (await storage.hasItem(key))
return await storage.getItem(key) as Promise<AppInfo>
return (storage.getItem(key, {}) as Promise<AppInfo>)
const appInfo = await fetchAppInfo(origin, server)
await storage.setItem(key, appInfo)
return appInfo