rollup-pluginutils
Advanced tools
Comparing version 2.0.0 to 2.0.1
# rollup-pluginutils changelog | ||
## 2.0.1 | ||
* Don't add extension to file with trailing dot ([#14](https://github.com/rollup/rollup-pluginutils/issues/14)) | ||
## 2.0.0 | ||
@@ -4,0 +8,0 @@ |
@@ -7,20 +7,10 @@ 'use strict'; | ||
var path = require('path'); | ||
var estreeWalker = require('estree-walker'); | ||
var path = require('path'); | ||
var mm = _interopDefault(require('micromatch')); | ||
function basename ( path$$1 ) { | ||
return path$$1.split( /(\/|\\)/ ).pop(); | ||
} | ||
function extname ( path$$1 ) { | ||
var match = /\.[^\.]+$/.exec( basename( path$$1 ) ); | ||
if ( !match ) { return ''; } | ||
return match[0]; | ||
} | ||
function addExtension ( filename, ext ) { | ||
if ( ext === void 0 ) ext = '.js'; | ||
if ( !extname( filename ) ) { filename += ext; } | ||
if ( !path.extname( filename ) ) { filename += ext; } | ||
return filename; | ||
@@ -27,0 +17,0 @@ } |
@@ -0,15 +1,5 @@ | ||
import { extname, resolve, sep } from 'path'; | ||
import { walk } from 'estree-walker'; | ||
import { resolve, sep } from 'path'; | ||
import mm from 'micromatch'; | ||
function basename ( path$$1 ) { | ||
return path$$1.split( /(\/|\\)/ ).pop(); | ||
} | ||
function extname ( path$$1 ) { | ||
var match = /\.[^\.]+$/.exec( basename( path$$1 ) ); | ||
if ( !match ) { return ''; } | ||
return match[0]; | ||
} | ||
function addExtension ( filename, ext ) { | ||
@@ -16,0 +6,0 @@ if ( ext === void 0 ) ext = '.js'; |
{ | ||
"name": "rollup-pluginutils", | ||
"description": "Functionality commonly needed by Rollup plugins", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "dist/pluginutils.cjs.js", | ||
@@ -6,0 +6,0 @@ "module": "dist/pluginutils.es.js", |
@@ -1,11 +0,3 @@ | ||
function basename ( path ) { | ||
return path.split( /(\/|\\)/ ).pop(); | ||
} | ||
import { extname } from 'path'; | ||
function extname ( path ) { | ||
const match = /\.[^\.]+$/.exec( basename( path ) ); | ||
if ( !match ) return ''; | ||
return match[0]; | ||
} | ||
export default function addExtension ( filename, ext = '.js' ) { | ||
@@ -12,0 +4,0 @@ if ( !extname( filename ) ) filename += ext; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29317
688