@putout/engine-runner 13.6.0 → 13.7.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.
@@ -117,6 +117,7 @@ function getStore(plugin, {fix, rule, shebang, msg, options}) {
117
117
  list.clear();
118
118
  upstore.clear();
119
119
  uplist.clear();
120
+
120
121
  return placesStore.clear();
121
122
  };
122
123
 
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const isString = (a) => typeof a === 'string';
4
-
5
3
  const {template} = require('@putout/engine-parser');
4
+
6
5
  const {
7
6
  remove,
8
7
  replaceWith,
@@ -14,9 +13,10 @@ const {
14
13
  setValues,
15
14
  } = require('@putout/compare');
16
15
  const debug = require('debug')('putout:runner:replace');
17
-
18
16
  const maybeArray = require('../maybe-array');
17
+
19
18
  const watermark = require('./watermark');
19
+ const isString = (a) => typeof a === 'string';
20
20
 
21
21
  const log = (from, path) => {
22
22
  debug.enabled && debug(`${from} -> ${path}\n`);
package/lib/run-fix.js CHANGED
@@ -4,7 +4,9 @@ const tryCatch = require('try-catch');
4
4
  const debug = require('debug')('putout:runner:fix');
5
5
  const {enabled} = debug;
6
6
  const {stringify} = JSON;
7
+
7
8
  const isFn = (a) => typeof a === 'function';
9
+ const getPath = (path) => path.path || path;
8
10
 
9
11
  const tryToFix = (fix, {path, position, options}) => {
10
12
  const [e] = tryCatch(fix, path, {options});
@@ -26,7 +28,9 @@ module.exports = (is, fix, {path, rule, position, options}) => {
26
28
  if (!is)
27
29
  return;
28
30
 
29
- enabled && debug(`fix: ${rule}`, position, path.toString());
31
+ if (enabled)
32
+ debug(`fix: ${rule}`, position, getPath(path).toString());
33
+
30
34
  validate('fix', fix);
31
35
 
32
36
  tryToFix(fix, {
package/lib/store.js CHANGED
@@ -22,6 +22,7 @@ module.exports.listStore = (list = new Set()) => {
22
22
  fn.clear = () => {
23
23
  const a = list;
24
24
  list = new Set();
25
+
25
26
  return Array.from(a);
26
27
  };
27
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "13.6.0",
3
+ "version": "13.7.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "run putout plugins",
@@ -47,7 +47,7 @@
47
47
  "eslint-plugin-node": "^11.0.0",
48
48
  "eslint-plugin-putout": "^15.0.0",
49
49
  "just-camel-case": "^4.0.2",
50
- "lerna": "^4.0.0",
50
+ "lerna": "^5.0.0",
51
51
  "madrun": "^9.0.0",
52
52
  "mock-require": "^3.0.3",
53
53
  "montag": "^1.0.0",