putout 33.9.2 → 33.11.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,33 @@
1
+ 2023.11.24, v33.11.0
2
+
3
+ fix:
4
+ - cd7b4035d @putout/plugin-filesystem: move-referenced-file: report
5
+
6
+ feature:
7
+ - ea0761c0f @putout/operator-filesystem: readFileContent/writeFileContent: emoji support
8
+ - a5004685f @putout/plugin-nodejs: rename-file-mjs-to-js: add
9
+ - a3653b742 @putout/plugin-nodejs: rename-file-cjs-to-js: add
10
+ - f957fe6a8 @putout/test: noReportAfterTransformWithOptions: add
11
+ - fe6cdf4c5 @putout/operator-filesystem: copyFile/moveFile: overwrite
12
+ - b59b533f2 @putout/plugin-putout: declare: copyFile: add
13
+ - 4712fb82e @putout/cli-filesystem: copyFile: add
14
+ - 528b36c9b @putout/operator-filesystem: copyFile/moveFile: overwrite
15
+ - 95d2fe901 @putout/operator-filesystem: copyFile: add
16
+
17
+ 2023.11.22, v33.10.0
18
+
19
+ fix:
20
+ - 86be2a3bb @putout/plugin-filesystem: options
21
+
22
+ feature:
23
+ - 8a4ddc626 @putout/cli-filesystem: removeFile: recursive
24
+ - 4a83bb83f putout: ignore: add ability to merge negated (kaelzhang/node-ignore#107)
25
+ - 340736186 @putout/plugin-filesystem: remove-files: add
26
+ - 725f8517e @putout/plugin-filesystem: move-referenced-file: add
27
+ - fb3cd2399 @putout/plugin-putout: replace-test-message: improve report/noTransform handling
28
+ - 1d5a722ab @putout/plugin-filesystem: rename-referenced-file: move renameFile to fix
29
+ - a322f2582 @putout/plugin-filesystem: rename-referenced-file: add
30
+
1
31
  2023.11.21, v33.9.2
2
32
 
3
33
  feature:
package/lib/merge.js CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  const deepmerge = require('deepmerge');
4
4
 
5
- const arrayUnion = (...a) => [...new Set(a.flat())];
5
+ const isString = (a) => typeof a === 'string';
6
+ const arrayUnion = (...a) => {
7
+ const flatten = a.flat();
8
+ return mergeIgnore(Array.from(new Set(flatten)));
9
+ };
6
10
 
7
11
  const arrayMerge = (a, b) => arrayUnion(b, a);
8
12
 
@@ -11,3 +15,25 @@ module.exports = (...args) => {
11
15
  arrayMerge,
12
16
  });
13
17
  };
18
+
19
+ function mergeIgnore(list) {
20
+ const negatives = [];
21
+
22
+ for (const current of list) {
23
+ if (isString(current) && current.startsWith('!'))
24
+ negatives.push(current.slice(1));
25
+ }
26
+
27
+ for (const current of negatives) {
28
+ const index = list.indexOf(current);
29
+
30
+ if (index >= 0) {
31
+ list.splice(index, 1);
32
+
33
+ const negIndex = list.indexOf(`!${current}`);
34
+ list.splice(negIndex, 1);
35
+ }
36
+ }
37
+
38
+ return list;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "33.9.2",
3
+ "version": "33.11.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, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
package/putout.json CHANGED
@@ -33,7 +33,9 @@
33
33
  ".filesystem.json": {
34
34
  "filesystem": "on",
35
35
  "nodejs/cjs-file": "on",
36
- "nodejs/mjs-file": "on"
36
+ "nodejs/mjs-file": "on",
37
+ "nodejs/rename-file-cjs-to-js": "on",
38
+ "nodejs/rename-file-mjs-to-js": "on"
37
39
  },
38
40
  "*.md": {
39
41
  "conditions/apply-consistent-blocks": "off",