Skip to content
Myr

refactor: remove unnessary type assertion (#3113)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 2yunseong · committed by GitHub · parent b4177b3 · Browse files · 1 file+3 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

Diff stats

1 file+3 added−6 removed

  • other:+3 added−6 removed

1 file+3 added−6 removed

modified:src/middleware/persist.ts+3 added-6 removed
45 unmodified lines
46 return null47 }48 return JSON.parse(str, options?.reviver) as StorageValue<S>49 }50 const str = (storage as StateStorage).getItem(name) ?? null50 const str = storage.getItem(name) ?? null51 if (str instanceof Promise) {52 return str.then(parse)53 }54 return parse(str)55 },56 setItem: (name, newValue) =>57 (storage as StateStorage).setItem(58 name,59 JSON.stringify(newValue, options?.replacer),60 ),61 removeItem: (name) => (storage as StateStorage).removeItem(name),57 storage.setItem(name, JSON.stringify(newValue, options?.replacer)),58 removeItem: (name) => storage.removeItem(name),59 }60 return persistStorage61}62
315 unmodified lines