New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-logger-namespace

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-logger-namespace - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

5

lib/index.js

@@ -15,3 +15,3 @@ 'use strict';

function pathToNamespace (path, _a) {
var stripPrefix = _a.stripPrefix, prefix = _a.prefix;
var stripPrefix = _a.stripPrefix, stripSubfix = _a.stripSubfix, prefix = _a.prefix;
var result = path.replace(/[/|\\]/g, ':');

@@ -21,2 +21,5 @@ if (stripPrefix !== undefined && result.startsWith(stripPrefix)) {

}
if (stripSubfix !== undefined && result.endsWith(stripSubfix)) {
result = result.slice(0, result.length - stripSubfix.length);
}
if (prefix !== undefined) {

@@ -23,0 +26,0 @@ result = prefix + result;

3

lib/pathToNamespace.d.ts
export declare type Options = {
stripPrefix?: string;
prefix?: string;
stripSubfix?: string;
};
export default function (path: string, { stripPrefix, prefix }: Options): string;
export default function (path: string, { stripPrefix, stripSubfix, prefix }: Options): string;
{
"name": "babel-plugin-logger-namespace",
"version": "0.1.0",
"version": "0.2.0",
"description": "Babel plugin that generates the namespace for creating a logger based on the path of the module",

@@ -5,0 +5,0 @@ "repository": {

@@ -35,2 +35,3 @@ # babel-plugin-logger-namespace

* stripPrefix?: Remove specified prefix from the resulting namespace
* prefix?: Add specified prefix to the resulting namespace
* prefix?: Add specified prefix to the resulting namespace
* stripSubfix?: Remove specified subfix from the resulting namespace

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc