@putout/operator-match-files 3.2.0 → 3.2.1

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,10 @@
1
1
  'use strict';
2
2
 
3
- const {join} = require('node:path');
3
+ const {
4
+ join,
5
+ basename,
6
+ extname,
7
+ } = require('node:path');
4
8
  const {parse, print} = require('@putout/engine-parser');
5
9
  const {transform} = require('putout/transform');
6
10
  const {findPlaces} = require('putout/find-places');
@@ -166,7 +170,8 @@ function getOutputFile(path, {dirPath, matchInputFilename, outputFilename, input
166
170
  function parseMatcher(matcher, options) {
167
171
  for (const [name, value] of entries(options)) {
168
172
  if (name === 'filename') {
169
- const [name, ext] = value.split('.');
173
+ const name = basename(value);
174
+ const ext = extname(value);
170
175
 
171
176
  matcher = matcher.replaceAll(`__name`, name);
172
177
  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.1",
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",