@putout/engine-runner 11.2.0 → 11.4.1

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.
package/lib/include.js CHANGED
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const log = require('debug')('putout:runner:include');
4
+ const maybeArray = require('./maybe-array');
4
5
 
6
+ const {stringify} = JSON;
5
7
  const stub = () => [];
6
8
  const good = () => true;
7
- const maybeArray = require('./maybe-array');
9
+ const isFn = (a) => typeof a === 'function';
8
10
 
9
11
  module.exports = ({rule, plugin, msg, options}) => {
10
12
  const {
@@ -15,6 +17,9 @@ module.exports = ({rule, plugin, msg, options}) => {
15
17
  filter = good,
16
18
  } = plugin;
17
19
 
20
+ if (!isFn(include))
21
+ throw Error(`☝️ Looks like "include" is not a function: ${stringify(include)}. More on using Includer: https://git.io/JqcMn`);
22
+
18
23
  const traverse = getTraverse(include(), filter, rule);
19
24
 
20
25
  return {
@@ -26,7 +26,7 @@ const isObj = (a) => typeof a === 'object';
26
26
  const validateTemplateValues = (a, b) => {
27
27
  for (const key of keys(a)) {
28
28
  if (!b[key])
29
- throw Error(`Looks like template values not linked: ${stringify(keys(a))} ${stringify(keys(b))}`);
29
+ throw Error(`☝️ Looks like template values not linked: ${stringify(keys(a))} ${stringify(keys(b))}`);
30
30
  }
31
31
  };
32
32
 
@@ -92,7 +92,7 @@ function wrapWithCheck({rule, nodesInclude, nodesExclude, fn}) {
92
92
  return;
93
93
 
94
94
  if (!isFn(fn))
95
- throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
95
+ throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
96
96
 
97
97
  const [e] = tryCatch(fn, path);
98
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "11.2.0",
3
+ "version": "11.4.1",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "run putout plugins",
6
6
  "homepage": "http://github.com/coderaiser/putout",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@babel/traverse": "^7.12.7",
27
27
  "@babel/types": "^7.12.7",
28
- "@putout/compare": "^7.6.0",
28
+ "@putout/compare": "^8.0.0",
29
29
  "@putout/engine-parser": "^4.0.1",
30
30
  "@putout/operate": "^6.0.0",
31
31
  "debug": "^4.1.1",
@@ -45,7 +45,7 @@
45
45
  "c8": "^7.5.0",
46
46
  "eslint": "^8.0.0-beta.0",
47
47
  "eslint-plugin-node": "^11.0.0",
48
- "eslint-plugin-putout": "^9.0.0",
48
+ "eslint-plugin-putout": "^10.0.0",
49
49
  "just-camel-case": "^4.0.2",
50
50
  "lerna": "^4.0.0",
51
51
  "madrun": "^8.0.1",