Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

objects.invert #105

Closed
3 tasks done
jkvyff opened this issue Dec 10, 2019 · 5 comments
Closed
3 tasks done

objects.invert #105

jkvyff opened this issue Dec 10, 2019 · 5 comments
Labels
enhancement New feature or request operator

Comments

@jkvyff
Copy link
Collaborator

jkvyff commented Dec 10, 2019

Creates a new object with key-value pairs inverted, in the case of duplicate values the latter value will overwrite the previous

Checklist

  • implementation
  • tests
  • jsdoc

Details

const res = Objects.invert({ a: 1, b: 2, c: 1 });
console.log(res);
> { '1': 'c', '2': 'b' }

References

@jkvyff jkvyff added enhancement New feature or request operator labels Dec 10, 2019
@evanplaice
Copy link
Member

FYI, if you want to take on arrays.frequency it's all yours.

@evanplaice
Copy link
Member

@jkvyff Your work on objects.invert got pushed to the master branch and some of the tests are failing.

https://github.com/vanillaes/absurdum/commit/6832265dc3e3ecec800e5f6ed9483ee603eb4d0b/checks?check_suite_id=350350872

@jkvyff
Copy link
Collaborator Author

jkvyff commented Dec 10, 2019

My mistake, I switched branches before making the changes to the tests.

@evanplaice
Copy link
Member

It's all good

Not publishing a broken build to NPM is what matters and the CD pre-checks make that impossible. 😁

@evanplaice
Copy link
Member

evanplaice commented Dec 10, 2019

Added in v0.47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request operator
Projects
None yet
Development

No branches or pull requests

2 participants