codekingpro/portable-devtools
115k
1'use strict'
2
3const Range = require('../classes/range')
4const validRange = (range, options) => {
5 try {
6 // Return '*' instead of '' so that truthiness works.
7 // This will throw if it's invalid anyway
8 return new Range(range, options).range || '*'
9 } catch (er) {
10 return null
11 }
12}
13module.exports = validRange
14 