Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,2 @@ | ||
import type { BunyanLikeLogger } from './decorator'; | ||
import { Bunyamin } from './decorator'; | ||
@@ -6,3 +7,4 @@ export * from './noopLogger'; | ||
export * from './wrapLogger'; | ||
declare const _default: Bunyamin<import("./noopLogger").NoopLogger>; | ||
export * from './is-debug'; | ||
declare const _default: Bunyamin<BunyanLikeLogger>; | ||
export default _default; |
@@ -1160,2 +1160,29 @@ (function (global, factory) { | ||
function createIsDebug(namespaces) { | ||
const skips = []; | ||
const names = []; | ||
for (const part of namespaces.split(/[\s,]+/)) { | ||
if (!part) { | ||
continue; | ||
} | ||
const destination = part[0] === '-' ? skips : names; | ||
const pattern = part.replace(/^-/, '').replace(/\*/g, '.*?'); | ||
destination.push(new RegExp(`^${pattern}$`)); | ||
} | ||
return function isDebug(name) { | ||
if (name[name.length - 1] === '*') { | ||
return true; | ||
} | ||
if (skips.some(regex => regex.test(name))) { | ||
return false; | ||
} | ||
if (names.some(regex => regex.test(name))) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
} | ||
const isDebug = createIsDebug(process.env.DEBUG || ''); | ||
var index = new Bunyamin({ | ||
@@ -1167,2 +1194,3 @@ logger: noopLogger() | ||
exports["default"] = index; | ||
exports.isDebug = isDebug; | ||
exports.noopLogger = noopLogger; | ||
@@ -1169,0 +1197,0 @@ exports.traceEventStream = traceEventStream; |
{ | ||
"name": "bunyamin", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Bunyan-based logger for Node.js supporting Trace Event format", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,1 +1,2 @@ | ||
import type { BunyanLikeLogger } from './decorator'; | ||
import { Bunyamin } from './decorator'; | ||
@@ -8,3 +9,4 @@ import { noopLogger } from './noopLogger'; | ||
export * from './wrapLogger'; | ||
export * from './is-debug'; | ||
export default new Bunyamin({ logger: noopLogger() }); | ||
export default new Bunyamin<BunyanLikeLogger>({ logger: noopLogger() }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
331270
138
4025
3