optional type specification

This commit is contained in:
2022-05-26 20:57:59 -05:00
parent 61b8924122
commit c4c6e9d2e9

View File

@@ -23,7 +23,7 @@ export class StorageBase {
return this.val.get() return this.val.get()
} }
getJson<T = JSONObject>(defaultValue?: T): T | {} { getJson<T = JSONObject>(defaultValue?: T): T {
try { try {
let val = JSON.parse(this.val.get()) let val = JSON.parse(this.val.get())
@@ -38,7 +38,7 @@ export class StorageBase {
return defaultValue return defaultValue
} }
return {} return {} as T
} }
} }