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:
@@ -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('');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user