No way to make default argument work. So I returned to the good old way:
class Colormap {
private currentPalette = "";
getColors(numberColors: number, whichPalette?: string): string[] {
const colors = palette(whichPalette ?? this.currentPalette, numberColors);
return colors.map((color) => `#${color}`);
}
}
This works and satisfy eslint.
Have a nice day!
mario
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…