Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function cleanupBorderStyle(borderStyle) {
if (!borderStyle) {
return 'single';
}
if (borderStyle in boxen._borderStyles) {
return borderStyle;
}
if (borderStyle.length !== 6) {
console.error('Specified custom border style is invalid');
process.exit(1);
}
// a string of 6 characters was given, make it a borderStyle object
return {
topLeft: borderStyle[0],
topRight: borderStyle[1],
bottomLeft: borderStyle[2],
bottomRight: borderStyle[3],
horizontal: borderStyle[4],
vertical: borderStyle[5]