Skip to content

Rudimo/range-array-to-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

range-array-to-string

Build Status

How to use

npm install range-array-to-string
const RangeArrayToString = require('range-array-to-string');

const rats = new RangeArrayToString();

rats.range([1, 2, 3, 5, 6, 7, 20])
    .then((string) => {
        // >> '1-3,5-7,20'
    })
    .catch((err) => {
        // handle error
    });

Array pre-sorting

const rats = new RangeArrayToString({sort: true});

rats.range([44, 20, 1, 2, 3, 5, 6, 7])
    .then((string) => {
        // >> '1-3,5-7,20,44'
    })

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published