Also works in the browser with browserify! This module is used by WebTorrent.
npm install bep53-range
Parse Magnet URI extension (BEP53) range and return all included values.
import { parse } from 'bep53-range'
const range = ['1-3', '6', '11-13']
const values = parse(range)
console.log(values) // [1, 2, 3, 6, 11, 12, 13]
Compose Magnet URI extension (BEP53) range from all included values.
import { compose } from 'bep53-range'
const values = [1, 2, 3, 6, 11, 12, 13]
const range = compose(values)
console.log(range) // ['1-3', '6', '11-13']
MIT. Copyright (c) Julen Garcia Leunda and WebTorrent, LLC.