Closed uinstinct closed 1 month ago
storage.local.get
can return any JSON serializable object, maybe
return data == null
? null
: typeof data === 'string'
? data
: JSON.stringify(data)
is more robust?
storage.local.get
can return any JSON serializable object, maybereturn data == null ? null : typeof data === 'string' ? data : JSON.stringify(data)
is more robust?
setItem has a type of string
on value argument. Hence, we can safely type it as string
yes, but the storage can be manipulated by other dependencies. it seems a little over-engineered as a template project. let's get it merged!
Description
The inferred type of
storedData[key]
in the changed line is inferred as unknown but theStorageLikeAsync
expects type as string.Linked Issues
Additional context