enforce strict typescript

This commit is contained in:
2022-03-01 02:00:01 +01:00
parent f185ccee03
commit 728ad56b33
7 changed files with 14 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ export class Files {
})
}
static fromString(s: string): Promise<Blob> {
static async fromString(s: string): Promise<Blob> {
return fetch(s).then((r) => r.blob())
}
}

View File

@@ -12,7 +12,7 @@
async function onInput(e: Event) {
const input = e.target as HTMLInputElement
if (input.files.length) {
if (input?.files?.length) {
files = Array.from(input.files)
const data: FileDTO[] = await Promise.all(
files.map(async (file) => ({

View File

@@ -8,7 +8,7 @@
import Icon from './Icon.svelte'
export let label: string = ''
export let value: string | number
export let value: any
export let copy: boolean = false
export let random: boolean = false

View File

@@ -33,7 +33,7 @@
message = $t('home.explanation', {
values: {
type: $t(timeExpiration ? 'common.minutes' : 'common.views', {
values: { n: timeExpiration ? note.expiration : note.views },
values: { n: (timeExpiration ? note.expiration : note.views) ?? '?' },
}),
},
})