var assert = require('assert') var Crypto = require('crypto') var fs = require('fs') var YAML = require('js-yaml') var Error = require('http-errors') var minimatch = require('minimatch') var Path = require('path') var LocalData = require('./local-data') var Utils = require('./utils') var pkg_file = '../package.yaml' var pkg = YAML.safeLoad(fs.readFileSync(__dirname+'/'+pkg_file, 'utf8')) // [[a, [b, c]], d] -> [a, b, c, d] function flatten(array) { var result = [] for (var i=0; i= last_suffix || (m[4] === '' && last_suffix !== Infinity)) { throw Error('invalid interval: ' + interval) } last_suffix = parse_interval_table[m[4]] result += Number(m[1]) * parse_interval_table[m[4]] }) return result }