@putout/operator-match-files 3.2.0 → 3.2.2

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.
@@ -1,6 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const {join} = require('node:path');
3
+ const {
4
+ join,
5
+ basename,
6
+ extname,
7
+ } = require('node:path');
8
+
4
9
  const {parse, print} = require('@putout/engine-parser');
5
10
  const {transform} = require('putout/transform');
6
11
  const {findPlaces} = require('putout/find-places');
@@ -166,7 +171,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
166
171
  function parseMatcher(matcher, options) {
167
172
  for (const [name, value] of entries(options)) {
168
173
  if (name === 'filename') {
169
- const [name, ext] = value.split('.');
174
+ const ext = extname(value);
175
+ const name = value.replace(ext, '');
170
176
 
171
177
  matcher = matcher.replaceAll(`__name`, name);
172
178
  matcher = matcher.replaceAll(`__ext`, ext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/operator-match-files",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout operator adds ability to match files to plugins",