refactor: simplify key further

zio/stable
Daniel Roe 2022-11-27 18:33:19 +00:00
parent f1a5108a06
commit 3d5a4e6a90
No known key found for this signature in database
GPG Key ID: 22D5008E4F5D9B55
1 changed files with 2 additions and 4 deletions

View File

@ -52,10 +52,8 @@ async function fetchAppInfo(server: string) {
return app
}
const serverKey = (host: string, server: string) => `servers:${host}:${server}.json`
export async function getApp(host: string, server: string) {
const key = serverKey(host, server)
export async function getApp(server: string) {
const key = `servers:${HOST_DOMAIN.replace(/[^\w\d]/g, '-')}:${server}.json`
try {
if (await storage.hasItem(key))