sindresorhus/electron-store

Types error with setting deserialize in v6.0.0

Ouverte

#133 ouverte le 29 juil. 2020

 (0 commentaire) (0 réaction) (0 personne assignée)JavaScript (150 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (4 304 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hi there, we override deserialize to use yaml instead; this previously use to work but a change in the typings of conf now means it doesn't compile in typescript.

serialize: yaml.safeDump,
deserialize: yaml.safeLoad,

Error:

Type '(str: string, opts?: LoadOptions | undefined) => string | object | undefined' is not assignable to type 'Deserialize<Record<string, any>>'.
  Type 'string | object | undefined' is not assignable to type 'Record<string, any>'.
    Type 'undefined' is not assignable to type 'Record<string, any>'.ts(2322)

Guide contributeur