putout 26.20.0 → 26.21.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.
package/ChangeLog CHANGED
@@ -1,3 +1,14 @@
1
+ 2022.06.29, v26.21.0
2
+
3
+ fix:
4
+ - (@putout/plugin-convert-comparison-to-boolean) report message
5
+
6
+
7
+ feature:
8
+ - (putout) check that source has type string
9
+ - (@putout/test) eslint: comparePlaces: add support of overrides
10
+
11
+
1
12
  2022.06.28, v26.20.0
2
13
 
3
14
  fix:
package/lib/putout.js CHANGED
@@ -13,6 +13,7 @@ const {
13
13
  } = require('@putout/engine-parser');
14
14
 
15
15
  const cutShebang = require('./cut-shebang');
16
+ const isString = (a) => typeof a === 'string';
16
17
 
17
18
  const defaultOpts = (opts = {}) => {
18
19
  const {
@@ -34,6 +35,8 @@ const defaultOpts = (opts = {}) => {
34
35
  };
35
36
 
36
37
  module.exports = (source, opts) => {
38
+ check(source);
39
+
37
40
  opts = defaultOpts(opts);
38
41
  const {
39
42
  parser,
@@ -131,3 +134,7 @@ module.exports.operator = {
131
134
  module.exports.ignores = require('./ignores');
132
135
  module.exports.codeframe = require('./codeframe');
133
136
 
137
+ function check(source) {
138
+ if (!isString(source))
139
+ throw Error(`☝️ Looks like 'source' has type '${typeof source}', expected: 'string'`);
140
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "26.20.0",
3
+ "version": "26.21.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊 Pluggable and configurable code transformer with built-in eslint and babel plugins support of js, jsx typescript, flow files, markdown, yaml and json",