New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rangify-string

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rangify-string

Create an array from a string of integer ranges.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

rangify-string

Build Status Current npm package version

Create an array from a string of integer ranges.

Installation

npm install --save rangify-string

Usage

const rangify = require('rangify-string');

rangify('1-3,5,9-10');
//=> [1, 2, 3, 5, 9, 10]

rangify('11,15-20');
//=> [11, 15, 16, 17, 18, 19, 20]

rangify('5-7,3-6', {
    sort: false,
    filter: false
})
//=> [5, 6, 7, 3, 4, 5, 6]

Options

PropertyDescriptionDefault
sortSort the output arraytrue
filterFilter duplicates from output arraytrue

Authors

  • Austin Gordon - Development - GitHub

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

integer

FAQs

Package last updated on 26 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts