@putout/operator-filesystem 4.0.0 → 4.1.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/lib/filesystem.js CHANGED
@@ -69,9 +69,10 @@ function findFile(node, name) {
69
69
 
70
70
  for (const filenamePath of traverseProperties(node, 'filename')) {
71
71
  const {value} = filenamePath.node.value;
72
+ const base = basename(value);
72
73
 
73
74
  for (const name of names) {
74
- if (value === name || getRegExp(name).test(basename(value)))
75
+ if (value === name || getRegExp(name).test(base))
75
76
  filePaths.push(filenamePath.parentPath);
76
77
  }
77
78
  }
@@ -196,7 +197,8 @@ function maybeRemoveFile(dirPath, filename) {
196
197
  }
197
198
 
198
199
  const dirPathFiles = getProperty(dirPath, 'files');
199
- const [fileToOverwrite] = findFile(dirPathFiles, filename);
200
+ const name = join(getFilename(dirPath), basename(filename));
201
+ const [fileToOverwrite] = findFile(dirPathFiles, name);
200
202
 
201
203
  if (!fileToOverwrite)
202
204
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/operator-filesystem",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout operator adds ability to filesystem referenced variables that was not defined",
@@ -38,10 +38,10 @@
38
38
  "devDependencies": {
39
39
  "@putout/engine-parser": "^10.0.2",
40
40
  "@putout/operator-json": "^2.0.0",
41
- "@putout/test": "^8.0.0",
41
+ "@putout/test": "^9.0.0",
42
42
  "c8": "^9.0.0",
43
- "eslint": "^9.0.0-alpha.0",
44
- "eslint-plugin-n": "^17.0.0-0",
43
+ "eslint": "^9.0.0",
44
+ "eslint-plugin-n": "^17.0.0",
45
45
  "eslint-plugin-putout": "^22.0.0",
46
46
  "lerna": "^6.0.1",
47
47
  "madrun": "^10.0.0",