Comparing version 0.2.0 to 1.0.0
@@ -42,2 +42,8 @@ /* | ||
// Normalize paths to be unix-style. | ||
var pathSeparatorRe = /[\/\\]/g; | ||
function normalizePath(path) { | ||
return path.replace(pathSeparatorRe, '/'); | ||
} | ||
// Match a filepath or filepaths against one or more wildcard patterns. Returns | ||
@@ -50,4 +56,4 @@ // all matching filepaths. This behaves just like minimatch.match, but supports | ||
// Normalize patterns and filepaths to flattened arrays. | ||
patterns = _.isArray(patterns) ? _.flatten(patterns) : [patterns]; | ||
filepaths = _.isArray(filepaths) ? _.flatten(filepaths) : [filepaths]; | ||
patterns = _.isArray(patterns) ? _.flattenDeep(patterns) : [patterns]; | ||
filepaths = _.isArray(filepaths) ? _.flattenDeep(filepaths) : [filepaths]; | ||
// Return empty set if there are no patterns or filepaths. | ||
@@ -76,5 +82,5 @@ if (patterns.length === 0 || filepaths.length === 0) { return []; } | ||
if (options.src) { | ||
patterns = _.isArray(options.src) ? _.flatten(options.src) : [options.src]; | ||
patterns = _.isArray(options.src) ? _.flattenDeep(options.src) : [options.src]; | ||
} else { | ||
patterns = _.flatten(args); | ||
patterns = _.flattenDeep(args); | ||
} | ||
@@ -96,3 +102,3 @@ // Return empty set if there are no patterns. | ||
matches = matches.map(function(filepath) { | ||
return path.join(srcBase, filepath); | ||
return normalizePath(path.join(srcBase, filepath)); | ||
}); | ||
@@ -106,3 +112,3 @@ } | ||
if (srcBase && !options.prefixBase) { | ||
filepath = path.join(srcBase, filepath); | ||
filepath = normalizePath(path.join(srcBase, filepath)); | ||
} | ||
@@ -125,3 +131,2 @@ try { | ||
var pathSeparatorRe = /[\/\\]/g; | ||
var extDotRe = { | ||
@@ -166,4 +171,4 @@ first: /(\.[^\/]*)?$/, | ||
// Normalize filepaths to be unix-style. | ||
dest = dest.replace(pathSeparatorRe, '/'); | ||
src = src.replace(pathSeparatorRe, '/'); | ||
dest = normalizePath(dest); | ||
src = normalizePath(src); | ||
// Map correct src path to dest path. | ||
@@ -170,0 +175,0 @@ if (fileByDest[dest]) { |
{ | ||
"name": "globule", | ||
"description": "An easy-to-use wildcard globbing library.", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/cowboy/node-globule", | ||
@@ -17,20 +17,18 @@ "author": { | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/cowboy/node-globule/blob/master/LICENSE-MIT" | ||
} | ||
"license": "MIT", | ||
"main": "lib/globule", | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/globule", | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
"node": ">= 0.10" | ||
}, | ||
"scripts": { | ||
"test": "grunt nodeunit" | ||
"test": "grunt" | ||
}, | ||
"devDependencies": { | ||
"grunt-contrib-jshint": "~0.8.0", | ||
"grunt-contrib-nodeunit": "~0.2.2", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt": "~0.4.2" | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-contrib-nodeunit": "^1.0.0", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt": "^1.0.0" | ||
}, | ||
@@ -49,6 +47,6 @@ "keywords": [ | ||
"dependencies": { | ||
"lodash": "~2.4.1", | ||
"glob": "~3.2.7", | ||
"minimatch": "~0.2.11" | ||
"glob": "~7.0.3", | ||
"lodash": "~4.9.0", | ||
"minimatch": "~3.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# globule [![Build Status](https://secure.travis-ci.org/cowboy/node-globule.png?branch=master)](http://travis-ci.org/cowboy/node-globule) | ||
# globule [![Build Status: Linux](https://travis-ci.org/cowboy/node-globule.svg?branch=master)](https://travis-ci.org/cowboy/node-globule) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/i9fnc38q952r9nc0/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/node-globule/branch/master) | ||
@@ -122,7 +122,8 @@ An easy-to-use wildcard globbing library. | ||
## Release History | ||
2014-01-07 - v0.2.0 - Updated dependencies. Added `src` option. Improved exclusion speed significantly. | ||
2016-04-14 - v1.0.0 - Update dependencies, lodash@4.9, glob@7.0, minimatch@3.0. Paths are unix-style with prefixBase enabled. | ||
2014-01-07 - v0.2.0 - Updated dependencies. Added `src` option. Improved exclusion speed significantly. | ||
2013-04-11 - v0.1.0 - Initial release. | ||
## License | ||
Copyright (c) 2014 "Cowboy" Ben Alman | ||
Copyright (c) 2016 "Cowboy" Ben Alman | ||
Licensed under the MIT license. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
129
14795
4
180
2
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.0.6(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedlodash@4.9.0(transitive)
+ Addedminimatch@3.0.8(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedglob@3.2.11(transitive)
- Removedlodash@2.4.2(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.2.140.3.0(transitive)
- Removedsigmund@1.0.1(transitive)
Updatedglob@~7.0.3
Updatedlodash@~4.9.0
Updatedminimatch@~3.0.0