optional type specification
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user