Skip to content

Commit

Permalink
5.0.1: fixes for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelzhang committed Aug 14, 2018
1 parent ef2b417 commit 7b962a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Expand Up @@ -9,7 +9,7 @@ module.exports = {
allowAfterThis: true,
enforceInMethodNames: false,
// node-ignore only
allow: ['_rules', '_filter']
allow: ['_rules', '_test']
}],

'indent': ['error', 2, {
Expand Down
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -543,17 +543,17 @@ if (
|| process.platform === 'win32'
)
) {
const filter = Ignore.prototype._filter
const test = Ignore.prototype._test

/* eslint no-control-regex: "off" */
const make_posix = str => /^\\\\\?\\/.test(str)
|| /[^\x00-\x80]+/.test(str)
? str
: str.replace(/\\/g, '/')

Ignore.prototype._filter = function filterWin32 (path, slices) {
Ignore.prototype._test = function testWin32 (path, ...args) {
path = make_posix(path)
return filter.call(this, path, slices)
return test.call(this, path, ...args)
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ignore",
"version": "5.0.0",
"version": "5.0.1",
"description": "Ignore is a manager and filter for .gitignore rules.",
"files": [
"legacy.js",
Expand Down

0 comments on commit 7b962a7

Please sign in to comment.