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:
parent
676470bae2
commit
5f2dca1979
5 changed files with 812 additions and 656 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue