mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
17 lines
362 B
JavaScript
17 lines
362 B
JavaScript
module.exports.list = function(val) {
|
|
return val.split(/\s*,\s*/g).filter(Boolean)
|
|
}
|
|
|
|
module.exports.size = function(val) {
|
|
var match = /^(\d+)x(\d+)$/.exec(val)
|
|
return match ? [+match[1], +match[2]] : undefined
|
|
}
|
|
|
|
module.exports.range = function(from, to) {
|
|
var items = []
|
|
, i
|
|
for (i = from; i <= to; ++i) {
|
|
items.push(i)
|
|
}
|
|
return items
|
|
}
|