putout v24.5.0
Compare
“There is nothing outside of yourself that can ever enable you to get better, stronger, richer, quicker, or smarter.
Everything is within. Everything exists. Seek nothing outside of yourself.”
(c) Miyamoto Musashi
Hi folks!
Today we talk about @putout/compare. It used a lot in Replacer and Includer.
Long time ago for simplification when types of nodes are different comparing started to go upwards.
But 🎩ESCover needs to preserve comparing with:
compare(path, 'const __a = __b', {
findUp: false,
});So:
const operator = getOperator(ret.argument || ret);Can be converted to:
const operator = (__c4['🧨'](4, 17), getOperator((__c4['🧨'](4, 29), ret.argument) || (__c4['🧨'](4, 45), ret)));Instead of:
const operator = (__c4['🧨'](4, 17), getOperator(ret.argument || ret));While SequenceExpressions like (__c4['🧨'](__d, __e), __f) are excluded.
🤷♂️ How it relates to ♨️Speca?
Well, ♨️Speca is a test generator based on 🐊Putout. Some cases wasn't covered, so I trapped on this.
Here is how it looks like:
That's all for today 🎈!
🐞 fix
- (putout) rm unused thread-it
🔥 feature
- (package) @putout/plugin-strict-mode v3.0.0
- (package) @putout/compare v8.7.0
- (@putout/compare) add findUp option
- (@putout/compare) add support of findUp
- (@putout/plugin-strict-mode) drop support of putout < 24
- (@putout/plugin-strict-mode) commonjs -> CommonJS
- (@putout/plugin-strict-mode) is esm -> in ESM

