Comparing version 3.0.5 to 3.0.6
@@ -182,2 +182,16 @@ 'use strict'; | ||
function make_posix(str) { | ||
return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') | ||
); | ||
}; | ||
if (process.platform === 'win32') { | ||
(function () { | ||
var _test = IgnoreBase.prototype._test; | ||
IgnoreBase.prototype._test = function (path) { | ||
return _test.call(this, make_posix(path)); | ||
}; | ||
})(); | ||
} | ||
// > If the pattern ends with a slash, | ||
@@ -194,4 +208,2 @@ // > it is removed for the purpose of the following description, | ||
// '`foo/`' should not continue with the '`..`' | ||
var REPLACERS = [ | ||
@@ -198,0 +210,0 @@ |
{ | ||
"name": "ignore", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "Ignore is a manager and filter for .gitignore rules.", | ||
@@ -5,0 +5,0 @@ "main": "./ignore.js", |
[![Build Status](https://travis-ci.org/kaelzhang/node-ignore.png?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) | ||
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/node-ignore) | ||
[![npm module downloads per month](http://img.shields.io/npm/dm/ignore.svg)](https://www.npmjs.org/package/ignore) | ||
@@ -10,6 +11,11 @@ | ||
## Tested on | ||
- Linux + Node: `0.8` - `5.x` | ||
- Windows + Node: `0.10` - `5.x`, node < `0.10` is not tested due to the lack of support of appveyor. | ||
## Usage | ||
```js | ||
var ignore = require('ignore') | ||
const ignore = require('ignore') | ||
var ig = ignore().add(['.abc/*', '!.abc/d/']) | ||
@@ -71,11 +77,17 @@ ``` | ||
<!-- ### .addIgnoreFile(path) | ||
### <strike>.addIgnoreFile(path)</strike> | ||
Adds rules from a ignore file or several files | ||
REMOVED in `3.x` for now. | ||
#### Returns `this` | ||
To upgrade `ignore@2.x` up to `3.x`, use | ||
#### Rule `String|Array.<String>` --> | ||
```js | ||
const fs = require('fs') | ||
ignore().add(fs.readFileSync(filename)) | ||
``` | ||
instead. | ||
### .filter(paths) | ||
@@ -104,5 +116,5 @@ | ||
[ | ||
'a/a.js' | ||
'.b', | ||
'.c/.DS_store' | ||
'a/a.js' | ||
'.b', | ||
'.c/.DS_store' | ||
] | ||
@@ -114,7 +126,10 @@ ``` | ||
```js | ||
var glob = require('glob') | ||
glob('**', function(err, files){ | ||
if ( err ) { | ||
console.log(err) | ||
return | ||
const glob = require('glob') | ||
glob('**', { | ||
// Adds a / character to directory matches. | ||
mark: true | ||
}, (err, files) => { | ||
if (err) { | ||
return console.error(err) | ||
} | ||
@@ -121,0 +136,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16061
308
143