gulp-order icon indicating copy to clipboard operation
gulp-order copied to clipboard

Allow to provide a custom rank function

Open Grohden opened this issue 7 years ago • 0 comments

The actual rank function isn't working for me.

We map every glob to a absolute path (this is an internal need ), and that makes the rank matcher not match on the rank function.

Say we have the following patterns:

[
"C:\folder\src\app\modules\analytics\**\*.config.js"
"C:\folder\src\app\modules\analytics\**\*.run.js"
"C:\folder\src\app\modules\analytics\**\*.filter.js"
"C:\folder\src\app\modules\analytics\**\*.controller.js"
"C:\folder\src\app\modules\analytics\**\*.directive.js"
"C:\folder\src\app\modules\analytics\**\*.service.js"
"C:\folder\src\app\modules\analytics\**\*.model.js"
"C:\folder\src\app\modules\analytics\**\*.factory.js"
]

With that, the rank function fails at the matcher.match(s), for example, with an given s = "test.config.js" the matcher of the first item of the array will not match (at least it's not matching for me).

I don't know if it's a bug with minimatch or a real bug, but allowing to provide a custom rank function would solve this problem for me.

Grohden avatar Mar 28 '18 21:03 Grohden