lukeed / klona

A tiny (240B to 501B) and fast utility to "deep clone" Objects, Arrays, Dates, RegExps, and more!
MIT License
1.62k stars 43 forks source link

.d.ts fix #21

Closed tripodsgames closed 4 years ago

tripodsgames commented 4 years ago

I use strict typescript. When I use klona/full I get the following error: Could not find a declaration file for module 'klona/full'. 'node_modules/klona/full/index.js' implicitly has an 'any' type. Try `npm install @types/klona` if it exists or add a new declaration (.d.ts) file containing `declare module 'klona/full';`

I fixed it by creating a custom definition file, but it would be nice if it was already defined.

declare module 'klona/full' {
    export function klona<T>(input: T): T;
}
lukeed commented 4 years ago

Ah thanks, I thought it would share the same types file but I guess not. Will fix soon!

tripodsgames commented 4 years ago

Ah thanks, I thought it would share the same types file but I guess not. Will fix soon!

if possible, fix this on dequal/lite too, I use your libraries a lot xD

lukeed commented 4 years ago

Definitely! Your issue made me think of a few I need to double-check :D

Appreciate it 🙇

lukeed commented 4 years ago

Fixed in v2.0.2

lukeed commented 4 years ago

And dequal@2.0.1