Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@politie/informant

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@politie/informant - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

13

dist/informant.cjs.js

@@ -256,7 +256,14 @@ 'use strict';

/**
* Ensures the provided handler only receives records for the logger with the given name or any of its children.
* Ensures the provided handler only receives records for:
* * the logger with the given name or any of its children, if provided with a string
* OR
* * the logger(s) matching the given regular expression
*/
function forLogger(name, handler) {
var nameWithDot = name + '.';
return function (record) { return (record.logger === name || record.logger.startsWith(nameWithDot)) && handler(record); };
if (typeof name === 'string') {
return function (record) { return (record.logger === name || record.logger.startsWith(name + '.')) && handler(record); };
}
else {
return function (record) { return name.test(record.logger) && handler(record); };
}
}

@@ -263,0 +270,0 @@ /**

@@ -253,7 +253,14 @@ import { __extends, __assign } from 'tslib';

/**
* Ensures the provided handler only receives records for the logger with the given name or any of its children.
* Ensures the provided handler only receives records for:
* * the logger with the given name or any of its children, if provided with a string
* OR
* * the logger(s) matching the given regular expression
*/
function forLogger(name, handler) {
var nameWithDot = name + '.';
return function (record) { return (record.logger === name || record.logger.startsWith(nameWithDot)) && handler(record); };
if (typeof name === 'string') {
return function (record) { return (record.logger === name || record.logger.startsWith(name + '.')) && handler(record); };
}
else {
return function (record) { return name.test(record.logger) && handler(record); };
}
}

@@ -260,0 +267,0 @@ /**

@@ -28,5 +28,8 @@ import { LogLevel } from './loglevel';

/**
* Ensures the provided handler only receives records for the logger with the given name or any of its children.
* Ensures the provided handler only receives records for:
* * the logger with the given name or any of its children, if provided with a string
* OR
* * the logger(s) matching the given regular expression
*/
export declare function forLogger(name: string, handler: LogHandler): LogHandler;
export declare function forLogger(name: string | RegExp, handler: LogHandler): LogHandler;
/**

@@ -33,0 +36,0 @@ * Wraps the given handler s.t. the handler is called asynchronously in a future tick.

{
"name": "@politie/informant",
"version": "1.0.1",
"version": "1.0.2",
"description": "Informant is a simple and fast logging library for Node.js and browser JavaScript applications.",

@@ -5,0 +5,0 @@ "main": "dist/informant.cjs.js",

Sorry, the diff of this file is not supported yet

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