@putout/engine-runner 15.1.0 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,9 +45,10 @@ function create(from, to, path) {
45
45
 
46
46
  module.exports.init = init;
47
47
  function init({path, program}) {
48
- path.node = path.node || {};
48
+ if (path.node) {
49
+ path.node[name] = path.node[name] || new Set();
50
+ }
49
51
 
50
- path.node[name] = path.node[name] || new Set();
51
52
  program.node[name] = program.node[name] || new Set();
52
53
  }
53
54
 
@@ -55,13 +56,13 @@ module.exports.add = add;
55
56
  function add({path, program, watermark, highWatermark}) {
56
57
  init({path, program});
57
58
 
58
- path.node[name].add(watermark);
59
+ path?.node[name].add(watermark);
59
60
  program.node[name].add(highWatermark);
60
61
  }
61
62
 
62
63
  module.exports.has = has;
63
64
  function has({path, program, watermark, highWatermark}) {
64
- if (path.node[name].has(watermark) || path.findParent(hasWatermark(watermark)))
65
+ if (path.node?.[name].has(watermark) || path.findParent(hasWatermark(watermark)))
65
66
  return true;
66
67
 
67
68
  if (program.node[name].has(highWatermark))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "15.1.0",
3
+ "version": "16.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Run 🐊Putout plugins",
@@ -27,7 +27,7 @@
27
27
  "@babel/traverse": "^7.12.7",
28
28
  "@babel/types": "^7.12.7",
29
29
  "@putout/compare": "^9.0.0",
30
- "@putout/engine-parser": "^5.0.0",
30
+ "@putout/engine-parser": "^6.0.0",
31
31
  "@putout/operate": "^8.0.0",
32
32
  "@putout/operator-declare": "^5.0.0",
33
33
  "debug": "^4.1.1",