ramda-adjunct icon indicating copy to clipboard operation
ramda-adjunct copied to clipboard

improve renameKeys type

Open mendrik opened this issue 1 year ago • 3 comments

Improves upon the object type in renameKeys. Not sure if this can be merged as is, but maybe it can be extended by someone who knows the project better than me

mendrik avatar Sep 18 '22 11:09 mendrik

Hi @mendrik,

Thanks for contributing. Would you be able to provide a test as well? See here how tests are done: https://github.com/char0n/ramda-adjunct/tree/master/test

char0n avatar Sep 18 '22 14:09 char0n

Hi @mendrik,

Thanks for contributing. Would you be able to provide a test as well? See here how tests are done: https://github.com/char0n/ramda-adjunct/tree/master/test

sorry if I misunderstand something, but the tests are testing the functionality while I have only improved upon the typescript types. Is there a way to test the typescript types for validity?

mendrik avatar Sep 19 '22 08:09 mendrik

Hi @mendrik,

Sorry, wrong url. Here is the right location: https://github.com/char0n/ramda-adjunct/tree/master/types/test

char0n avatar Sep 19 '22 10:09 char0n

ok so I got stuck with this:

import * as RA from 'ramda-adjunct';

RA.renameKeys({ A: 'B'} as const, { A: 1, C: 4 }).B; // $ExpectType number

doesn't seem to work

mendrik avatar Sep 24 '22 14:09 mendrik

ok so I got stuck with this:

import * as RA from 'ramda-adjunct';

RA.renameKeys({ A: 'B'} as const, { A: 1, C: 4 }).B; // $ExpectType number

doesn't seem to work

I've issued a PR that should remedy your issue: https://github.com/char0n/ramda-adjunct/pull/2368. Rebase on top of the master branch and things should work as expected again.

char0n avatar Sep 28 '22 15:09 char0n

closing, sorry it is constantly misbehaving for me in the tests, even after rebasing. image

mendrik avatar Oct 01 '22 19:10 mendrik

@mendrik,

Sorry for your trouble. I was able to successfully incorporate your change into the codebase in https://github.com/char0n/ramda-adjunct/pull/2370. I've properly attributed you in the commit.

Again sorry for the trouble and thanks for contributing!

char0n avatar Oct 02 '22 17:10 char0n

@mendrik,

Sorry for your trouble. I was able to successfully incorporate your change into the codebase in #2370. I've properly attributed you in the commit.

Again sorry for the trouble and thanks for contributing!

awesome, thanks a bunch for not letting it go to waste! :)

mendrik avatar Oct 02 '22 18:10 mendrik