putout 33.9.2 → 33.10.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 +14 -0
- package/lib/merge.js +27 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
2023.11.22, v33.10.0
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- 86be2a3bb @putout/plugin-filesystem: options
|
|
5
|
+
|
|
6
|
+
feature:
|
|
7
|
+
- 8a4ddc626 @putout/cli-filesystem: removeFile: recursive
|
|
8
|
+
- 4a83bb83f putout: ignore: add ability to merge negated (kaelzhang/node-ignore#107)
|
|
9
|
+
- 340736186 @putout/plugin-filesystem: remove-files: add
|
|
10
|
+
- 725f8517e @putout/plugin-filesystem: move-referenced-file: add
|
|
11
|
+
- fb3cd2399 @putout/plugin-putout: replace-test-message: improve report/noTransform handling
|
|
12
|
+
- 1d5a722ab @putout/plugin-filesystem: rename-referenced-file: move renameFile to fix
|
|
13
|
+
- a322f2582 @putout/plugin-filesystem: rename-referenced-file: add
|
|
14
|
+
|
|
1
15
|
2023.11.21, v33.9.2
|
|
2
16
|
|
|
3
17
|
feature:
|
package/lib/merge.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const deepmerge = require('deepmerge');
|
|
4
4
|
|
|
5
|
-
const
|
|
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.
|
|
3
|
+
"version": "33.10.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",
|