Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-numeric-range

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-numeric-range - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

index.js

@@ -8,3 +8,3 @@ function parsePart(str) {

// 1-5 or 1..5 (equivilant) or 1...5 (doesn't include 5)
if((m = str.match(/^(-?\d+)(-|\.\.\.?)(-?\d+)$/))) {
if((m = str.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/))) {
var lhs = m[1];

@@ -20,3 +20,3 @@ var sep = m[2];

// Make it inclusive by moving the right 'stop-point' away by one.
if(sep == '-' || sep == '..') {
if(sep == '-' || sep == '..' || sep == '\u2025') {
rhs += incr;

@@ -23,0 +23,0 @@ }

{
"name": "parse-numeric-range",
"version": "0.0.1",
"version": "0.0.2",
"description": "Takes a string, such as \"1,2,3-10,5-8\" and turns it into an array of numbers",

@@ -5,0 +5,0 @@ "main": "index.js",

node-parse-numeric-range
========================
Parses expressions like 1-10,20-30. Returns an energetic array.
Parses expressions like 1-10,20-30. Returns an energetic (as opposed to lazy) array.

@@ -18,2 +18,3 @@

| -1-2,-2 |[-1,0,1,2,-2] |
| -1--2 |[-1,-2] |
| -1..2,-2 |[-1,0,1,2,-2] |

@@ -20,0 +21,0 @@ | -1...3,-2 |[-1,0,1,2,-2] |

@@ -46,3 +46,12 @@ var expect = require('chai').expect;

});
it('should parse 1‥3', function() {
peq('1‥3', [1,2,3]);
});
it('should parse 1⋯3', function() {
peq('1⋯3', [1,2]);
});
it('should parse 1…3', function() {
peq('1…3', [1,2]);
});
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc