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

your example doesn't work #3

Closed
someone235 opened this issue May 10, 2017 · 1 comment
Closed

your example doesn't work #3

someone235 opened this issue May 10, 2017 · 1 comment
Labels

Comments

@someone235
Copy link
Contributor

When I write this code:

var filter = require("filter-values");

const x = filter({a: 'a', b: 'b', c: 'c'}, function(value, key, obj) {
  return key !== 'b';
});

console.log(x.b);

The output I get is: "b". I would expect it to be undefined. I guess this is because you call isMatch(val), and you don't include the key in the callback arguments.

@doowb doowb added the bug label May 10, 2017
@doowb
Copy link
Collaborator

doowb commented May 10, 2017

Looks like a bug was introduced in #2 (I believe that the key and obj should also be passed in).

If you'd like to do a PR to fix this, that'd be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants