Open coderaiser opened 3 years ago
Both parts of expression:
const nodeTypes = Array.isArray(matcher.nodeType) ? matcher.nodeType : matcher.nodeType
Returns same result, and can be simplified to:
matcher.nodeType
Just landed this case to @putout/plugin-simplify-ternary ๐ With commit https://github.com/coderaiser/putout/commit/c08ec496d62fe1786d2f9031d4957789c3e28cb9
Actually this was a bug and the else condition should be [matcher.nodeType]. Weird that I missed this...
[matcher.nodeType]
There is more such cases, you can find them with putout :). Static analysis canโt be to much.
putout
Both parts of expression:
Returns same result, and can be simplified to:
Just landed this case to @putout/plugin-simplify-ternary ๐
With commit https://github.com/coderaiser/putout/commit/c08ec496d62fe1786d2f9031d4957789c3e28cb9