@putout/engine-runner
Advanced tools
Comparing version 9.0.1 to 9.1.0
@@ -8,4 +8,4 @@ 'use strict'; | ||
const name = '_putout_runner_replace'; | ||
const hasWatermark = (watermark) => (path) => path[name] && path[name].has(watermark); | ||
const name = '__putout_runner_replace'; | ||
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark); | ||
@@ -47,4 +47,6 @@ module.exports = (from, to, path) => { | ||
function init({path, program}) { | ||
path[name] = path[name] || new Set(); | ||
program[name] = program[name] || new Set(); | ||
path.node = path.node || {}; | ||
path.node[name] = path.node[name] || new Set(); | ||
program.node[name] = program.node[name] || new Set(); | ||
} | ||
@@ -54,4 +56,5 @@ | ||
function add({path, program, watermark, highWatermark}) { | ||
path[name].add(watermark); | ||
program[name].add(highWatermark); | ||
init({path, program}); | ||
path.node[name].add(watermark); | ||
program.node[name].add(highWatermark); | ||
} | ||
@@ -61,6 +64,6 @@ | ||
function has({path, program, watermark, highWatermark}) { | ||
if (path[name].has(watermark) || path.findParent(hasWatermark(watermark))) | ||
if (path.node[name].has(watermark) || path.findParent(hasWatermark(watermark))) | ||
return true; | ||
if (program[name].has(highWatermark)) | ||
if (program.node[name].has(highWatermark)) | ||
return true; | ||
@@ -67,0 +70,0 @@ |
{ | ||
"name": "@putout/engine-runner", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -32,4 +32,4 @@ "description": "run putout plugins", | ||
"dependencies": { | ||
"@babel/traverse": "^7.6.2", | ||
"@babel/types": "^7.12.6", | ||
"@babel/traverse": "^7.12.7", | ||
"@babel/types": "^7.12.7", | ||
"@putout/compare": "^6.0.0", | ||
@@ -36,0 +36,0 @@ "@putout/engine-parser": "^3.0.0", |
26378
646
Updated@babel/traverse@^7.12.7
Updated@babel/types@^7.12.7