Skip to content

Commit

Permalink
Merge pull request #18 from josh-gaby/main
Browse files Browse the repository at this point in the history
color calc() swap out the usage of eval for a function constructor
  • Loading branch information
yorickshan authored Jul 12, 2024
2 parents c2f5175 + 8b9af86 commit f97e4b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/css/types/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const _color = (context: Context, args: CSSValue[]) => {
.replace(/g|y/, color[1].toString())
.replace(/b|z/, color[2].toString());

return eval(expression);
return new Function('return ' + expression)();
}
}

Expand Down

0 comments on commit f97e4b4

Please sign in to comment.