kriszyp / msgpackr

Ultra-fast MessagePack implementation with extension for record and structural cloning / msgpack.org[JavaScript/NodeJS]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error TS1385 when building with TypeScript

jpacios opened this issue · comments

Hi,

I am getting this when trying to build some code with TypeScript:

$ tsc
../node_modules/msgpackr/index.d.ts(10,24): error TS1385: Function type notation must be parenthesized when used in a union type.

msgpackr version: 1.9.3
typescript version: 4.5.5 (also happens in version 5)

The solution is to make this change in line 10 of index.d.ts:

useRecords?: boolean | ((value:any)=> boolean)

Fixed by #115, published in 1.9.4.

Works perfectly. Thanks!