gitignore-globs
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -24,5 +24,7 @@ 'use strict'; | ||
if (!isFile(pattern)) { | ||
// Create pair of globs. | ||
if (pattern.slice(-1) !== '/') { | ||
var suffix = (pattern.slice(-1) == '*') ? '*' : '/**' | ||
var suffix = (pattern.slice(-1) == '*') ? '*' : '/**'; | ||
if (pattern.slice(-1) === '/') { | ||
pattern = [pattern + suffix]; | ||
} else { | ||
// Create pair of globs. | ||
pattern = [pattern, pattern + suffix]; | ||
@@ -29,0 +31,0 @@ } |
{ | ||
"name": "gitignore-globs", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Parse a .gitignore file into an array of glob patterns.", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "^2.2.0", | ||
"chai": "^2.2.0", | ||
"mocha": "^2.2.4", | ||
@@ -35,0 +35,0 @@ "multimatch": "^2.0.0" |
@@ -55,2 +55,12 @@ var multimatch = require('multimatch'); | ||
it('should match dir', function() { | ||
var files = ['/foo', '/foo/', 'bar', 'bar/foo', 'bar/foo/baz']; | ||
var patterns = ['foo/']; | ||
var globs = parse._map(patterns); | ||
var result = multimatch(files, globs); | ||
expect(result).to.eql(['/foo/', 'bar/foo/baz']); | ||
}); | ||
it('should match glob pattern', function() { | ||
@@ -57,0 +67,0 @@ var files = ['bar', 'foo/', 'foo/bar', 'foo/bar/baz']; |
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
7467
122