Skip to content

Commit

Permalink
Drop non-styles from exposed style names
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Oct 5, 2022
1 parent 92c55db commit bc60dcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/index.js
Expand Up @@ -209,9 +209,10 @@ export {
stderrColor as supportsColorStderr,
};

const nonStyles = new Set(['close', 'ansi', 'ansi256', 'ansi16m']);
export const modifiers = Object.keys(ansiStyles.modifier);
export const foregroundColors = Object.keys(ansiStyles.color);
export const backgroundColors = Object.keys(ansiStyles.bgColor);
export const foregroundColors = Object.keys(ansiStyles.color).filter(style => nonStyles.has(style));
export const backgroundColors = Object.keys(ansiStyles.bgColor).filter(style => nonStyles.has(style));
export const colors = [...foregroundColors, ...backgroundColors];

export default chalk;

0 comments on commit bc60dcf

Please sign in to comment.