Comparing version 3.1.0 to 3.1.1
@@ -42,13 +42,8 @@ 'use strict'; | ||
if (pattern instanceof IgnoreBase) { | ||
this._rules = this._rules.concat(pattern._rules); | ||
this._added = true; | ||
} else { | ||
if (typeof pattern === 'string') { | ||
pattern = pattern.split(/\r?\n/g); | ||
} | ||
make_array(pattern).forEach(this._addPattern, this); | ||
if (typeof pattern === 'string') { | ||
pattern = pattern.split(/\r?\n/g); | ||
} | ||
make_array(pattern).forEach(this._addPattern, this); | ||
// Some rules have just added to the ignore, | ||
@@ -73,2 +68,8 @@ // making the behavior changed. | ||
value: function _addPattern(pattern) { | ||
if (pattern instanceof IgnoreBase) { | ||
this._rules = this._rules.concat(pattern._rules); | ||
this._added = true; | ||
return; | ||
} | ||
if (this._checkPattern(pattern)) { | ||
@@ -75,0 +76,0 @@ var rule = this._createRule(pattern); |
{ | ||
"name": "ignore", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Ignore is a manager and filter for .gitignore rules.", | ||
@@ -5,0 +5,0 @@ "main": "./ignore.js", |
@@ -75,3 +75,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-ignore.svg?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) | ||
- pattern `String|Ignore` An ignore pattern string, or the `Ignore` instance(to inherit the rules of another `Ignore` instance) | ||
- pattern `String|Ignore` An ignore pattern string, or the `Ignore` instance | ||
- patterns `Array.<pattern>` Array of ignore patterns. | ||
@@ -96,2 +96,4 @@ | ||
`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. | ||
### <strike>.addIgnoreFile(path)</strike> | ||
@@ -179,3 +181,3 @@ | ||
The code of `node-ignore` is based on es6 and babel, but the dependency of babel and its preset is not included in the `dependencies` field of package.json, so that the installation process of test cases will not fail in older versions of node. | ||
The code of `node-ignore` is based on es6 and babel, but babel and its preset is not included in the `dependencies` field of package.json, so that the installation process of test cases will not fail in older versions of node. | ||
@@ -182,0 +184,0 @@ So use `bash install.sh` to install dependencies and `bash test.sh` to run test cases in your local machine. |
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
18265
189