Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// return options.dimBorder ? chalk.dim(newBorder) : newBorder;
// @ts-ignore
if (borderColors[side]) {
// @ts-ignore
border = chalk.rgb(...borderColors[side])(border);
}
// if (backgroundColor) {
// // @ts-ignore
// border = chalk.bgRgb(...backgroundColor)(border);
// }
return border;
};
const contentWidth = widestLine(children) + padding.left + padding.right;
const paddingLeft = PAD.repeat(padding.left);
const { columns } = termSize();
let marginLeft = PAD.repeat(margin.left);
if (alignSelf === 'center') {
const padWidth = Math.max((columns - contentWidth) / 2, 0);
marginLeft = PAD.repeat(padWidth);
} else if (alignSelf === 'flex-end') {
const padWidth = Math.max(columns - contentWidth - margin.right - 2, 0);
marginLeft = PAD.repeat(padWidth);
}
const horizontal = chars.horizontal.repeat(contentWidth);
const top = hasBorders
? colorizeBorder(
NL.repeat(margin.top) +
marginLeft +
chars.topLeft +
mergeMap(output =>
iif(
() => Boolean(filepath),
writeFile(filepath, output),
of(output).pipe(
tap(res => {
console.log(res);
})
)
)
)
);
export {colors};
export const terminalColumns = termsize().columns;
size(): { columns: number; rows: number } {
return cliSize();
}
export const getColumns = () => termSize().columns - (process.env.NODE_ENV === 'test' ? 20 : 1) - logConfig.indent;
export const maxCellSize = () => terminal().columns / 4
input = arrify(input);
const keys = [];
const vals = [];
for (const x of input) {
vals.push(objectValues(x));
for (const y of Object.keys(x)) {
if (keys.indexOf(y) === -1) {
keys.push(y);
}
}
}
const width = Math.floor(termSize.columns / (keys.length + 1));
const table = new CliTable(Object.assign({
head: keys,
colWidths: fillArray([width], keys.length)
}, opts));
for (const x of vals) {
table.push(x);
}
return table;
};