sindresorhus/electron-store

Types error with setting deserialize in v6.0.0

開放

#133 建立於 2020年7月29日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (150 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (4,304 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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)

貢獻者指南