mirror of
https://github.com/bower/bower.git
synced 2026-02-12 06:55:04 -05:00
CS.
This commit is contained in:
@@ -2,7 +2,7 @@ var mout = require('mout');
|
||||
|
||||
var paddings = {
|
||||
tag: 10,
|
||||
tagPlusLabel: 30
|
||||
tagPlusLabel: 35
|
||||
};
|
||||
|
||||
var tagColors = {
|
||||
@@ -11,8 +11,6 @@ var tagColors = {
|
||||
'_default': 'cyan',
|
||||
};
|
||||
|
||||
// -------------------------
|
||||
|
||||
function renderData(data) {
|
||||
// Ensure data
|
||||
data.data = data.data || '';
|
||||
@@ -33,7 +31,7 @@ function renderError(err) {
|
||||
str += err.details + '\n';
|
||||
}
|
||||
|
||||
// Print trace
|
||||
// Print stack
|
||||
str += '\n' + err.stack + '\n';
|
||||
|
||||
return str;
|
||||
@@ -69,7 +67,7 @@ function renderTagPlusLabel(data) {
|
||||
length = tag.length + label.length + 1;
|
||||
nrSpaces = paddings.tagPlusLabel - length;
|
||||
|
||||
// Make at least one space
|
||||
// Ensure at least one space
|
||||
if (nrSpaces < 1) {
|
||||
nrSpaces = 1;
|
||||
}
|
||||
@@ -77,6 +75,8 @@ function renderTagPlusLabel(data) {
|
||||
return tag[tagColor] + mout.string.repeat(' ', nrSpaces) + label.green;
|
||||
}
|
||||
|
||||
// -------------------------
|
||||
|
||||
module.exports.colorful = {};
|
||||
module.exports.colorful.head = empty;
|
||||
module.exports.colorful.tail = empty;
|
||||
|
||||
@@ -30,6 +30,8 @@ function stringify(data) {
|
||||
return uncolor(circularJson.stringify(data, null, ' '));
|
||||
}
|
||||
|
||||
// -------------------------
|
||||
|
||||
module.exports.head = renderHead;
|
||||
module.exports.tail = renderTail;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ function empty() {
|
||||
return '';
|
||||
}
|
||||
|
||||
// -------------------------
|
||||
|
||||
module.exports.data = empty;
|
||||
module.exports.error = empty;
|
||||
module.exports.end = empty;
|
||||
Reference in New Issue
Block a user