fill-range
Advanced tools
Comparing version
{ | ||
"name": "fill-range", | ||
"description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"homepage": "https://github.com/jonschlinkert/fill-range", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
@@ -130,12 +130,12 @@ # fill-range [](https://www.npmjs.com/package/fill-range) [](https://npmjs.org/package/fill-range) [](https://travis-ci.org/jonschlinkert/fill-range) | ||
Optionally pass a custom function as the third or fourth argument or on `options.transform`. | ||
Optionally pass a custom function as last argument or on `options.transform`. | ||
```js | ||
fill('a', 'e', function (val, isNumber, pad, i) { | ||
if (!isNumber) { | ||
return String.fromCharCode(val) + i; | ||
} | ||
return val; | ||
// increase padding by two | ||
var arr = fill('01', '05', function(val, a, b, step, idx, arr, options) { | ||
return repeat('0', (options.maxLength + 2) - val.length) + val; | ||
}); | ||
//=> ['a0', 'b1', 'c2', 'd3', 'e4'] | ||
console.log(arr); | ||
//=> ['0001', '0002', '0003', '0004', '0005'] | ||
``` | ||
@@ -142,0 +142,0 @@ |
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
14224
0.37%0
-100%