Skip to content

Commit

Permalink
fix(colors): remove useless default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 4, 2021
1 parent 6dd5833 commit f78284e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ type BaseColor = keyof typeof Colors;
type PaletteColor = keyof typeof ColorPalette;
type Color = BaseColor;

const hashString = (name = '') => {
const hashString = (name: string) => {
return name.length;
};

const getColorByName = (name = ''): string => {
const getColorByName = (name: string): string => {
const palette = Object.keys(ColorPalette);
const colorIdx = hashString(name) % palette.length;
const paletteColor = palette[colorIdx] as PaletteColor;
Expand Down

0 comments on commit f78284e

Please sign in to comment.