atom / fuzzaldrin

Fuzzy filtering and string scoring
MIT License
319 stars 28 forks source link

Wrongly ordered candidates with exact file name match #18

Open elmariofredo opened 9 years ago

elmariofredo commented 9 years ago
var candidates, filter, results;

filter = require('fuzzaldrin').filter;

candidates = ['test/components/core/application/applicationPageStateServiceSpec.js', 'test/components/core/view/components/actions/actionsServiceSpec.js'];

results = filter(candidates, 'actionsServiceSpec.js');

console.log(results);

This is what I get

[ 'test/components/core/application/applicationPageStateServiceSpec.js',
  'test/components/core/view/components/actions/actionsServiceSpec.js' ]

This is what I expect

[ 'test/components/core/view/components/actions/actionsServiceSpec.js',
  'test/components/core/application/applicationPageStateServiceSpec.js' ]

as actionsServiceSpec.js is exact file name match

walles commented 9 years ago

PR #15 may or may not resolve this.

elmariofredo commented 9 years ago

confirmed #15 is fixing my issue. Thanks

mnquintana commented 9 years ago

Gonna keep this open since #15 isn't merged yet

elmariofredo commented 9 years ago

ok

walles commented 9 years ago

@elmariofredo Can you test PR #22 and see if that resolves your issue as well?