forked from M3-Academy/challenge-vtex-io
14 lines
222 B
TypeScript
14 lines
222 B
TypeScript
|
export const sanatizeColor = (color: string) => {
|
||
|
if (color) {
|
||
|
const [first] = color.split(" ");
|
||
|
|
||
|
if (first.indexOf("c-") === 0) {
|
||
|
return first;
|
||
|
}
|
||
|
|
||
|
return "c-on-base";
|
||
|
}
|
||
|
|
||
|
return "c-on-base";
|
||
|
};
|