Sha256: 1f23a92e126ae58a029b531b7aed4032d3f89c5bcc7cdab084e9482f104a7871
Contents?: true
Size: 701 Bytes
Versions: 4
Compression:
Stored size: 701 Bytes
Contents
'use strict' module.exports = Base => class extends Base { warn (code, message, data = {}) { if (this.file) data.file = this.file if (this.cwd) data.cwd = this.cwd data.code = message instanceof Error && message.code || code data.tarCode = code if (!this.strict && data.recoverable !== false) { if (message instanceof Error) { data = Object.assign(message, data) message = message.message } this.emit('warn', data.tarCode, message, data) } else if (message instanceof Error) { this.emit('error', Object.assign(message, data)) } else this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } }
Version data entries
4 entries across 4 versions & 1 rubygems