2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

chore(ci): improved contributors & PRs sections generator; (#5453)

This commit is contained in:
Dmitriy Mozgovoy
2023-01-09 15:24:02 +02:00
committed by GitHub
parent 18772ed8fd
commit e2a1e280f6
7 changed files with 279 additions and 139 deletions
+14
View File
@@ -0,0 +1,14 @@
import chalk from 'chalk';
export const colorize = (...colors)=> {
if(!colors.length) {
colors = ['green', 'magenta', 'cyan', 'blue', 'yellow', 'red'];
}
const colorsCount = colors.length;
return (strings, ...values) => {
const {length} = values;
return strings.map((str, i) => i < length ? str + chalk[colors[i%colorsCount]].bold(values[i]) : str).join('');
}
}