chore: code formatting

This commit is contained in:
github-actions[bot]
2022-04-23 23:18:43 +00:00
parent 73cd43c18f
commit 4c98629bbc
130 changed files with 1839 additions and 1788 deletions

View File

@@ -10,7 +10,7 @@ export default async function({q, imports, data, account}, {enabled = false} = {
let {url, datapoints, lowalert, highalert, urgentlowalert, urgenthighalert} = imports.metadata.plugins.nightscout.inputs({data, account, q})
if (!url || url === "https://example.herokuapp.com")
throw {error:{message:"Nightscout site URL isn't set!"}}
throw {error: {message: "Nightscout site URL isn't set!"}}
if (url.substring(url.length - 1) !== "/")
url += "/"
if (url.substring(0, 7) === "http://")
@@ -44,13 +44,13 @@ export default async function({q, imports, data, account}, {enabled = false} = {
resp.data[i].color = color
resp.data[i].alert = alertName
}
return {data:resp.data.reverse()}
return {data: resp.data.reverse()}
}
//Handle errors
catch (error) {
if (error.error?.message)
throw error
throw {error:{message:"An error occured", instance:error}}
throw {error: {message: "An error occured", instance: error}}
}
}