babel-plugin-logger-namespace
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -17,7 +17,7 @@ 'use strict'; | ||
var result = path.replace(/[/|\\]/g, ':'); | ||
if (stripPrefix !== undefined && result.startsWith(stripPrefix)) { | ||
result = result.slice(stripPrefix.length); | ||
if (stripPrefix !== undefined) { | ||
result = result.replace(new RegExp("^(".concat(stripPrefix, ")")), ''); | ||
} | ||
if (stripSubfix !== undefined && result.endsWith(stripSubfix)) { | ||
result = result.slice(0, result.length - stripSubfix.length); | ||
if (stripSubfix !== undefined) { | ||
result = result.replace(new RegExp("(".concat(stripSubfix, ")$")), ''); | ||
} | ||
@@ -24,0 +24,0 @@ if (prefix !== undefined) { |
{ | ||
"name": "babel-plugin-logger-namespace", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Babel plugin that generates the namespace for creating a logger based on the path of the module", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -34,4 +34,4 @@ # babel-plugin-logger-namespace | ||
* stripPrefix?: Remove specified prefix from the resulting namespace | ||
* stripPrefix?: Remove specified prefix from the resulting namespace. You can set multiple of them by separating each item with a `|`. e.g. `foo:|bar:` will remove both foo and bar from the prefix. | ||
* prefix?: Add specified prefix to the resulting namespace | ||
* stripSubfix?: Remove specified subfix from the resulting namespace | ||
* stripSubfix?: Remove specified subfix from the resulting namespace. Same as `stripPrefix`, it supports multiple subfixes that separated by `|`. |
Sorry, the diff of this file is not supported yet
8897