Sha256: e451dff75ce154f2c43384937f68d0c914cd4f13b208838c566a3bb91e985be4
Contents?: true
Size: 937 Bytes
Versions: 36
Compression:
Stored size: 937 Bytes
Contents
'use strict' // tar -u const hlo = require('./high-level-opt.js') const r = require('./replace.js') // just call tar.r with the filter and mtimeCache module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) { throw new TypeError('file is required') } if (opt.gzip || opt.brotli || opt.file.endsWith('.br') || opt.file.endsWith('.tbr')) { throw new TypeError('cannot append to compressed archives') } if (!files || !Array.isArray(files) || !files.length) { throw new TypeError('no files or directories specified') } files = Array.from(files) mtimeFilter(opt) return r(opt, files, cb) } const mtimeFilter = opt => { const filter = opt.filter if (!opt.mtimeCache) { opt.mtimeCache = new Map() } opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) }
Version data entries
36 entries across 36 versions & 2 rubygems