d3 / d3-color

Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
https://d3js.org/d3-color
ISC License
398 stars 91 forks source link

Fixed: Invalid regular expression #65

Closed imchintan closed 4 years ago

imchintan commented 4 years ago

Invalid regular expression: /^rgb([\s([+-]?\d+)\s,\s([+-]?\d+)\s,\s([+-]?\d+)\s])$/: Unmatched ')'

mbostock commented 4 years ago

No explanation given and unable to reproduce the error.

jariztia commented 4 years ago

I had the same issue, and I found that another dependency was changing the Array.prototype.toString function to separate items with , (comma and space). This was especifically rlab from npmjs.

To test this you can console.log(Array.prototype.toString) and it will point to the wrong function when changed, or it will say "native code" if it hasn't been replaced.

You can see in the first line of the images the difference on the toString function: image

What it should say: image