Add isHSLA().
Refer to the following issue (Similar but not the same) #1156.
Also, refer to the following PR raised #1156
Finally, check on the docs of MDN and W3Resource
would this not just be a redirect to the isHSL PR ? so more a change/feature on #1156 that it also supports alpha i.e. hsla() and not just hsl()
@AubreyHewes based on the feedback received on #1159, @guischafer mentioned the following when I asked on the same
The hsla has an extra parameter, alpha, which can hold values between [0,1]. Therefore, it should have its own validator function.
May be @profnandaa and @guischafer could add something on the same.
In my opinion, semantically would be better to have this two separated. They are, indeed, correlated, but I wouldn't expect to receive "true" as an return value from a isHSL function when passing a hsla string. Futhermore, I think mixing this two would expand, in a bad way, the responsability of the function. What do you guys think?
I would love to pick this up, can I take it up?
@lytes20 please raise a PR.
Upon refining PR https://github.com/validatorjs/validator.js/pull/1159, I agree with @AubreyHewes to simply redirect to the isHSL() validator. Further research into hsl() revealed that hsla() is merely an alias to hsl(). hsl() supports an optional 4th parameter for the alpha channel. In fact, you can use hsla() with only 3 parameters (without alpha) and it will still work because it is actually hsl().
Most helpful comment
In my opinion, semantically would be better to have this two separated. They are, indeed, correlated, but I wouldn't expect to receive "true" as an return value from a isHSL function when passing a hsla string. Futhermore, I think mixing this two would expand, in a bad way, the responsability of the function. What do you guys think?