color-js / color.js

Color conversion & manipulation library by the editors of the CSS Color specifications
https://colorjs.io
MIT License
1.93k stars 81 forks source link

Avoid Nullish coalescing operator to support old Node.js #205

Closed ai closed 2 years ago

ai commented 2 years ago

We are adding color.js to Stylelint for cool color-no-out-gamut-range rule.

But ?? operator from color.js sources breaks Node.js 12 and 14 support:

    /home/runner/work/stylelint/stylelint/node_modules/colorjs.io/dist/color.cjs:328
            let coords = options.coords ?? this.base.coords;
                                         ^

    SyntaxError: Unexpected token '?'
LeaVerou commented 2 years ago

Hm, I suppose we could add Babel for the generated bundles and use a NodeJS 12 target.