expand-range
Advanced tools
Comparing version 1.5.0 to 1.6.0
21
index.js
@@ -12,3 +12,3 @@ /*! | ||
module.exports = function expandRange(str, fn) { | ||
module.exports = function expandRange(str, options, fn) { | ||
if (typeof str !== 'string') { | ||
@@ -18,3 +18,14 @@ throw new TypeError('expand-range expects a string.'); | ||
if (typeof options === 'function') { | ||
fn = options; | ||
options = {}; | ||
} | ||
if (typeof options === 'boolean') { | ||
options = {}; | ||
options.makeRe = true; | ||
} | ||
// create arguments to pass to fill-range | ||
var opts = options || {}; | ||
var args = str.split('..'); | ||
@@ -28,11 +39,7 @@ var len = args.length; | ||
if (typeof fn === 'boolean' && fn === true) { | ||
fn = '~'; | ||
if (len === 3) { | ||
args[len - 1] += fn; | ||
fn = null; | ||
} | ||
opts.makeRe = true; | ||
} | ||
args.push(opts); | ||
return fill.apply(fill, args.concat(fn)); | ||
}; |
{ | ||
"name": "expand-range", | ||
"description": "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"homepage": "https://github.com/jonschlinkert/expand-range", | ||
@@ -32,3 +32,3 @@ "author": { | ||
"dependencies": { | ||
"fill-range": "^1.7.1" | ||
"fill-range": "^1.9.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -103,3 +103,3 @@ # expand-range [![NPM version](https://badge.fury.io/js/expand-range.svg)](http://badge.fury.io/js/expand-range) | ||
_This file was generated by [verb](https://github.com/assemble/verb) on January 24, 2015._ | ||
_This file was generated by [verb](https://github.com/assemble/verb) on January 25, 2015._ | ||
@@ -106,0 +106,0 @@ [fill-range]: https://github.com/jonschlinkert/fill-range |
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
4663
33
Updatedfill-range@^1.9.0