Yes, sure, I know how to write custom functions. I’m wondering why such a function doesn’t exist in the official APIs. It seems that it’s something that would be widely useful.
if(layer.isGroup()) {}
vs
if(layer.kind === constants.layerKind.GROUP) {}
Yes, you could also shorten constants.layerKind.GROUP if you import differently, but yes, I think it would still be useful to have the isGroup()method.
As I mentioned, you can extend the layer API and add this method (or ant other you’d find useful). I personally don’t see an issue, that method doesn’t exist by default, as it’s still a one-liner with a single condition