fix typing of app value for npm check (#7883)

This commit is contained in:
wendrul
2026-02-10 17:28:50 +01:00
committed by GitHub
parent 3257bc5079
commit f2359ee284
3 changed files with 6 additions and 4 deletions

View File

@@ -152,7 +152,8 @@
console.log('app', app)
let result: { kind: Kind; path: string }[] = []
if (app.raw_app) {
for (const runnable of Object.values(app.value.runnables as Record<string, Runnable>)) {
const rawAppValue = app.value as { runnables?: Record<string, Runnable> }
for (const runnable of Object.values(rawAppValue.runnables ?? {})) {
if (isRunnableByPath(runnable)) {
if (runnable.runType == 'script') {
result.push({ kind: 'script', path: runnable.path })

View File

@@ -128,8 +128,9 @@
}
sendUserToast('App restored from browser storage', false, actions)
app_w_draft.value = stateLoadedFromLocalStorage
files = app_w_draft.value.files as any
runnables = app_w_draft.value.runnables as any
const rawValue = app_w_draft.value as any
files = rawValue.files as any
runnables = rawValue.runnables as any
redraw += 1
} else if (app_w_draft.draft) {
extractRawApp(app_w_draft.draft)

View File

@@ -36,7 +36,7 @@
let can_write = $derived(canWrite(page.params.path ?? '', app?.extra_perms ?? {}, $userStore))
function getRunnables(app: AppWithLastVersion) {
return (app?.value?.runnables ?? {}) as Record<string, Runnable>
return ((app?.value as any)?.runnables ?? {}) as Record<string, Runnable>
}
</script>