parse-glob
Advanced tools
Comparing version 1.0.0 to 1.0.1
13
index.js
@@ -11,2 +11,3 @@ /*! | ||
var pathRe = require('glob-path-regex'); | ||
var isGlob = require('is-glob'); | ||
@@ -26,4 +27,6 @@ /** | ||
module.exports = function parseGlob(pattern) { | ||
// leave `pattern` unmodified | ||
var glob = pattern; | ||
var tok = {}; | ||
tok.isGlob = isGlob(pattern); | ||
@@ -72,7 +75,7 @@ var braces = pattern.indexOf('{') !== -1; | ||
if (braces) { | ||
tok.dirname = unescape(tok.dirname); | ||
tok.filename = unescape(tok.filename); | ||
tok.basename = unescape(tok.basename); | ||
tok.extname = unescape(tok.extname); | ||
tok.ext = unescape(tok.ext); | ||
tok.dirname = tok.dirname ? unescape(tok.dirname) : ''; | ||
tok.filename = tok.filename ? unescape(tok.filename) : ''; | ||
tok.basename = tok.basename ? unescape(tok.basename) : ''; | ||
tok.extname = tok.extname ? unescape(tok.extname) : ''; | ||
tok.ext = tok.ext ? unescape(tok.ext) : ''; | ||
} | ||
@@ -79,0 +82,0 @@ |
{ | ||
"name": "parse-glob", | ||
"description": "Parse a glob pattern into an object of path parts.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jonschlinkert/parse-glob", | ||
@@ -32,3 +32,4 @@ "author": { | ||
"dependencies": { | ||
"glob-path-regex": "^1.0.0" | ||
"glob-path-regex": "^1.0.0", | ||
"is-glob": "^1.1.0" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
@@ -23,3 +23,4 @@ # parse-glob [![NPM version](https://badge.fury.io/js/parse-glob.svg)](http://badge.fury.io/js/parse-glob) | ||
```js | ||
{ pattern: 'a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js', | ||
{ isGlob: true, | ||
pattern: 'a/b/{c,.gitignore,{a,b}}/{a,b}/*.foo.js', | ||
dirname: 'a/b/{c,.gitignore,{a,b}}/{a,b}/', | ||
@@ -32,3 +33,3 @@ filename: '*.foo.js', | ||
// detects when a glob pattern intentionally | ||
// specifies dotfiles | ||
// specifies dotfiles or dot directories (e.g. './.git/') | ||
dotfiles: false, | ||
@@ -35,0 +36,0 @@ dotdirs: false } |
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
4877
85
64
2
+ Addedis-glob@^1.1.0
+ Addedis-glob@1.1.3(transitive)