Socket
Socket
Sign inDemoInstall

fill-range

Package Overview
Dependencies
5
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

28

index.js

@@ -27,3 +27,9 @@ /*!

// store a ref to unmodified args
var strA = a.toString();
var strB = b.toString();
var expand;
b = (b.toString() === '-0') ? 0 : b;
if (typeof step === 'string') {

@@ -46,5 +52,2 @@ if (/\?/.test(step)) {

// store a ref to the unmodified first arg
var strA = a.toString();
// is the range alphabetical? or numeric?

@@ -62,3 +65,3 @@ var isNumeric = isNumber(a);

// detect padding
var padding = isPadded(strA, isNumeric);
var padding = isPadded(strA, strB);
var res, pad, arr = [];

@@ -92,8 +95,9 @@ var i = 0;

function isPadded(strA, isNumeric) {
return isNumeric && /^-*0+[1-9]/.test(strA)
? function (a) {
var num = strA.length - a.toString().length;
return repeat('0', num);
} : false;
function isPadded(strA, strB) {
if ((!/[^.]\./.test(strA) || !/[^.]\./.test(strB)) && /^-*0+[1-9]/.test(strA)) {
return function (a) {
return repeat('0', strA.length - a.toString().length);
}
}
return false;
}

@@ -106,6 +110,6 @@

if (!isNumber(a) && isNumber(b)) {
throw new TypeError('fill-range: incompatible range arguments.');
throw new TypeError('fill-range: first range argument is incompatible with second.');
}
if (isNumber(a) && !isNumber(b)) {
throw new TypeError('fill-range: incompatible range arguments.');
throw new TypeError('fill-range: first range argument is incompatible with second.');
}

@@ -112,0 +116,0 @@ if (step && (!isNumber(step) && !/>/.test(step))) {

{
"name": "fill-range",
"description": "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/jonschlinkert/fill-range",

@@ -6,0 +6,0 @@ "author": {

@@ -154,2 +154,2 @@ # fill-range [![NPM version](https://badge.fury.io/js/fill-range.svg)](http://badge.fury.io/js/fill-range)

_This file was generated by [verb](https://github.com/assemble/verb) on January 04, 2015._
_This file was generated by [verb](https://github.com/assemble/verb) on January 08, 2015._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc