Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (input) {
var messages = input.messages;
var source = input.source;
if (!messages.length) {
return ' ' + logSymbols.success + ' No collisions found.';
}
var filename = underline(logFrom(source)) + '\n';
return filename + table(messages.map(function (msg) {
var last = msg.text.lastIndexOf('(');
var warning = msg.text.slice(0, last).trim();
var position = msg.text.slice(last, msg.text.length);
return [
'',
gray('line ' + msg.node.source.start.line),
gray('col ' + msg.node.source.start.column),
warning,
gray(position)
];
})) + collisions(messages);
};
const applySingleStyle = memoize((key: string, value: string, text: string) => {
switch (key) {
case 'fontWeight':
return value === 'bold' ? colorette.bold(text) : text;
case 'fontStyle':
return value === 'italic' ? colorette.italic(text) : text;
case 'textDecoration': {
switch (value) {
case 'line-through':
return colorette.strikethrough(text);
case 'underline':
return colorette.underline(text);
default:
return text;
}
}
case 'textTransform': {
switch (value) {
case 'uppercase':
return text.toUpperCase();
case 'lowercase':
return text.toLowerCase();
case 'capitalize':
return capitalize(text);
default:
return text;
}
}