You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
541 B
JavaScript

'use strict';
const chalk = require("chalk");
const ansiStyles = require("ansi-styles");
const pad = require("pad");
function grayBackground(string) {
return ansiStyles.bgColor.ansi256.rgb(33, 33, 33) + string + ansiStyles.bgColor.close;
}
module.exports = function sectionTag(sectionName, {isArray} = {isArray: false}) {
let arrayPrefix;
if (isArray) {
arrayPrefix = chalk.red.bold("[]");
} else {
arrayPrefix = " ";
}
return `${arrayPrefix} ${grayBackground(`${pad(10, sectionName)} ->`)}`;
}