decompress(files, next) { if (!_.isArray(files)) { const fromFile = this.server.path(files); const toDir = fromFile.substring(0, _.lastIndexOf(fromFile, '/')); this.systemDecompress(fromFile, toDir, next); } else if (_.isArray(files)) { Async.eachLimit(files, 1, (file, callback) => { const fromFile = this.server.path(file); const toDir = fromFile.substring(0, _.lastIndexOf(fromFile, '/')); this.systemDecompress(fromFile, toDir, callback); }, next); } else { return next(new Error('Invalid datatype passed to decompression function.')); } }
_parseDeclaration(args) { let def = args.def; const title = args.title; def = def.trim(); assert(def, `Invalid ${ title }: ${ def }`); let pos = _.lastIndexOf(def, '*'); if (pos === -1) { pos = _.lastIndexOf(def, ' '); } if (pos === -1) { pos = def.length - 1; } let part1 = def.substr(0, pos + 1).trim(); let part2 = def.substr(pos + 1).trim(); if (!part1 && part2) { part1 = part2; part2 = null; } assert(part1, `Invalid ${ title }: ${ def }`); if (!part2 && !args.defaultName) { assert(false, `${ title } declaration's name expected.`); } return { name: part2 || args.defaultName, type: this._makeRef(part1, args.isInterface) }; }
def = def.trim(); assert(def, 'Invalid ' + title + ': ' + def); var pos = _.lastIndexOf(def, '*'); if (pos === -1) { pos = _.lastIndexOf(def, ' ');