javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

DataFrame.rename() mapper arg should be typed instead of any #345

Closed Devwulf closed 2 years ago

Devwulf commented 2 years ago

In version 1.0.0, the DataFrame.rename() mapper argument is typed as any instead of strongly typed. This caused me to completely miss the fact that the mapper argument is now outside the options argument while migrating to this new version of Danfojs, and it may lead others to do so as well. Wouldn't it be better to type it something like this?

type Mapper = {
    [index: string]: string | number;
}
risenW commented 2 years ago

@Devwulf Good point. Would you like sending a PR?

Devwulf commented 2 years ago

@Devwulf Good point. Would you like sending a PR?

Sure, I'll get on it tomorrow morning!