Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case 'at': return [k, v === 'error' ? red(v) : other(v)]
case 'desc': return [k, red(v)]
case 'code': return [k, red.bold(v)]
case 'method': return [k, method(v)]
case 'dyno': return [k, getColorForIdentifier(v)(v)]
case 'status': return [k, status(v)]
case 'path': return [k, path(v)]
case 'connect': return [k, ms(v)]
case 'service': return [k, ms(v)]
default: return [k, other(v)]
}
})
.map(([k, v]) => other(k + '=') + v)
.join(' ')
} catch (err) {
ux.warn(err)
return body
}
}
return [
stateChange[1],
state(stateChange[2]),
stateChange[3] || '',
state(stateChange[4] || '')
].join('')
}
let exited = body.match(/^(Process exited with status )(\d+)$/)
if (exited) {
return [
exited[1],
exited[2] === '0' ? c.greenBright(exited[2]) : c.red(exited[2])
].join('')
}
} catch (err) {
ux.warn(err)
}
return body
}
other(tokens[4]),
status(tokens[5]),
other(tokens[6])
].join('')
}
let route = body.match(/^(.* ")(\w+)(.+)(HTTP\/\d+\.\d+" .*)$/)
if (route) {
return [
route[1],
method(route[2]),
path(route[3]),
route[4]
].join('')
}
} catch (err) {
ux.warn(err)
}
return body
}
return [
stateChange[1],
state(stateChange[2]),
stateChange[3] || '',
state(stateChange[4] || '')
].join('')
}
let exited = body.match(/^(Process exited with status )(\d+)$/)
if (exited) {
return [
exited[1],
exited[2] === '0' ? c.greenBright(exited[2]) : c.red(exited[2])
].join('')
}
} catch (err) {
ux.warn(err)
}
return body
}
return parts
} else if (parts.length === 2) {
return encodeColor(parts)
} else {
return encodeColor([parts[0], parts.splice(1).join("=")])
}
})
return tokens.map(([k, v]) => {
if (v === undefined) {
return other(k)
}
return other(k + '=') + v
}).join(' ')
} catch (err) {
ux.warn(err)
return body
}
}
other(tokens[4]),
status(tokens[5]),
other(tokens[6])
].join('')
}
let route = body.match(/^(.* ")(\w+)(.+)(HTTP\/\d+\.\d+" .*)$/)
if (route) {
return [
route[1],
method(route[2]),
path(route[3]),
route[4]
].join('')
}
} catch (err) {
ux.warn(err)
}
return body
}