@putout/engine-runner
Advanced tools
Comparing version 13.0.1 to 13.1.0
@@ -20,4 +20,4 @@ 'use strict'; | ||
if (!isFn(include)) | ||
throw Error(`☝️ Looks like "include" is not a function: ${stringify(include)}. More on using Includer: https://git.io/JqcMn`); | ||
validate('include', include); | ||
validate('report', report); | ||
@@ -68,1 +68,5 @@ const traverse = getTraverse(include(), filter, rule); | ||
function validate(name, fn) { | ||
if (!isFn(fn)) | ||
throw Error(`☝️ Looks like '${name}' is not a 'function' but '${typeof fn}' with value: '${stringify(fn)}'. More on using Includer: https://git.io/JqcMn`); | ||
} |
@@ -6,2 +6,4 @@ 'use strict'; | ||
const {enabled} = debug; | ||
const {stringify} = JSON; | ||
const isFn = (a) => typeof a === 'function'; | ||
@@ -29,2 +31,3 @@ const tryToFix = (fix, {path, position, options}) => { | ||
enabled && debug(`fix: ${rule}`, position, path.toString()); | ||
validate('fix', fix); | ||
@@ -38,1 +41,6 @@ tryToFix(fix, { | ||
function validate(name, fn) { | ||
if (!isFn(fn)) | ||
throw Error(`☝️ Looks like '${name}' is not a 'function' but '${typeof fn}' with value: '${stringify(fn)}'. More on writing 🐊Putout Plugins: https://git.io/JqcMn`); | ||
} | ||
{ | ||
"name": "@putout/engine-runner", | ||
"version": "13.0.1", | ||
"version": "13.1.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
@@ -6,3 +6,3 @@ # @putout/engine-runner [![NPM version][NPMIMGURL]][NPMURL] | ||
Run 🐊[`Putout`](https://github.com/coderaiser/putout) plugins. | ||
Run 🐊[**Putout**](https://github.com/coderaiser/putout) plugins. | ||
@@ -17,3 +17,3 @@ ## Install | ||
There is a couple plugin types supported by 🐊`Putout`: | ||
There is a couple plugin types supported by 🐊**Putout**: | ||
@@ -25,9 +25,9 @@ - ✅[`Replacer`](#replacer) | ||
All of them supports subset of `JavaScript` 🦎[`PutoutScript`](https://github.com/coderaiser/putout/blob/master/docs/putout-script.md#-putoutscript) described in [@putout/compare](https://github.com/coderaiser/putout/tree/master/packages/compare#readme). | ||
All of them supports subset of **JavaScript** 🦎[**PutoutScript**](https://github.com/coderaiser/putout/blob/master/docs/putout-script.md#-putoutscript) described in [`@putout/compare`](https://github.com/coderaiser/putout/tree/master/packages/compare#readme). | ||
They goes from simplest to hardest. Let's start from `Replacer`. | ||
They goes from simplest to hardest. Let's start from **Replacer**. | ||
### Replacer | ||
`Replacer` converts code in declarative way. Simplest possible form, no need to use `fix`. Just `from` and `to` parts | ||
**Replacer** converts code in declarative way. Simplest possible form, no need to use `fix`. Just `from` and `to` parts | ||
according to [`template variables syntax`](https://github.com/coderaiser/putout/tree/master/packages/compare#supported-template-variables). | ||
@@ -69,3 +69,3 @@ | ||
module.exports.replace = () => ({ | ||
'debugger': '', | ||
debugger: '', | ||
}); | ||
@@ -217,4 +217,4 @@ ``` | ||
const plugins = [{ | ||
rule: "remove-debugger", | ||
msg: "", // optional | ||
rule: 'remove-debugger', | ||
msg: '', // optional | ||
options: {}, // optional | ||
@@ -241,3 +241,3 @@ plugin: { | ||
Stores is preferred way of keeping 🐊`Putout` data, `traverse` init function called only once, and any other way | ||
Stores is preferred way of keeping 🐊**Putout** data, `traverse` init function called only once, and any other way | ||
of handling variables will most likely will lead to bugs. There is 3 store types: | ||
@@ -244,0 +244,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30602
722