Comparing version 0.6.2 to 0.7.1
@@ -10,2 +10,3 @@ 'use strict'; | ||
var globby = require('globby'); | ||
var isGlob = require('is-glob'); | ||
@@ -67,3 +68,5 @@ /** | ||
function glob(patterns, opts) { | ||
if (!isGlob(patterns)) { return [patterns]; } | ||
opts = opts || {}; | ||
if (typeof opts.glob === 'function') { | ||
@@ -84,3 +87,3 @@ return opts.glob(patterns, opts); | ||
function name(fp, acc, opts) { | ||
var fn = (opts && opts.name) || opts.renameKey; | ||
var fn = opts && (opts.name || opts.renameKey); | ||
if (typeof fn === 'function') { | ||
@@ -87,0 +90,0 @@ return fn(fp, acc, opts); |
{ | ||
"name": "map-files", | ||
"description": "Return an object for a glob of files. Pass a `rename` function for the keys, or a `parse` function for the content, allowing it to be used for readable or require-able files.", | ||
"version": "0.6.2", | ||
"version": "0.7.1", | ||
"homepage": "https://github.com/jonschlinkert/map-files", | ||
@@ -10,7 +10,13 @@ "author": { | ||
}, | ||
"repository": "jonschlinkert/map-files", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jonschlinkert/map-files.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/jonschlinkert/map-files/issues" | ||
}, | ||
"license": "MIT", | ||
"license": { | ||
"type": "MIT", | ||
"url": "https://github.com/jonschlinkert/map-files/blob/master/LICENSE-MIT" | ||
}, | ||
"files": [ | ||
@@ -27,3 +33,4 @@ "index.js" | ||
"dependencies": { | ||
"globby": "^1.1.0" | ||
"globby": "^1.2.0", | ||
"is-glob": "^1.1.3" | ||
}, | ||
@@ -55,2 +62,2 @@ "devDependencies": { | ||
] | ||
} | ||
} |
@@ -13,10 +13,2 @@ # map-files [![NPM version](https://badge.fury.io/js/map-files.svg)](http://badge.fury.io/js/map-files) [![Build Status](https://travis-ci.org/jonschlinkert/map-files.svg)](https://travis-ci.org/jonschlinkert/map-files) | ||
## Running tests | ||
Install dev dependencies. | ||
```bash | ||
npm i -d && npm test | ||
``` | ||
## Usage | ||
@@ -102,3 +94,18 @@ | ||
## Other files libs | ||
* [file-reader](https://github.com/jonschlinkert/file-reader): Read a glob of files, dynamically choosing the reader or requiring the files based on the file extension. | ||
* [filter-files](https://github.com/jonschlinkert/filter-files): Recursively read directories and return a list of files, filtered to have only the files for which the (optional) filter function returns `true`. Sync and async. | ||
* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch (10-45x faster on avg). Just use `minimatch.isMatch()` instead of `multimatch()` or `minimatch()`. | ||
* [export-files](https://github.com/jonschlinkert/export-files): node.js utility for exporting a directory of files as modules. | ||
## Running tests | ||
Install dev dependencies. | ||
```bash | ||
npm i -d && npm test | ||
``` | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/map-files/issues) | ||
## Author | ||
@@ -117,4 +124,4 @@ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 01, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 22, 2015._ | ||
[globby]: https://github.com/sindresorhus/globby | ||
[globby]: https://github.com/sindresorhus/globby |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8941
102
124
1
2
+ Addedis-glob@^1.1.3
+ Addedis-glob@1.1.3(transitive)
Updatedglobby@^1.2.0