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

@dotcom-tool-kit/logger

Package Overview
Dependencies
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotcom-tool-kit/logger - npm Package Compare versions

Comparing version 4.0.0-beta.0 to 4.0.0

5

lib/format.js

@@ -25,5 +25,6 @@ "use strict";

}
else {
if (!info.process) {
// simulate the newline present in a normal console.log (which we've
// removed from the Console transport)
// removed from the Console transport to support logging forked
// processes which don't necessarilly flush on a newline)
message += '\n';

@@ -30,0 +31,0 @@ }

16

lib/helpers.js

@@ -12,5 +12,5 @@ "use strict";

const ansiRegexText = (0, ansi_regex_1.default)().source;
const whitespaceRegex = /\s|\n/g;
const startRegex = new RegExp(`^(?:(?:${ansiRegexText})|\s|\n)+`);
const endRegex = new RegExp(`(?:(?:${ansiRegexText})|\s|\n)+$`);
const ansiOrWhitespaceRegexText = `(?:(?:${ansiRegexText})|\\n)+`;
const startRegex = new RegExp(`^${ansiOrWhitespaceRegexText}`);
const endRegex = new RegExp(`${ansiOrWhitespaceRegexText}$`);
// RIS escape code to effectively do a clear (^L) on the terminal. TypeScript's

@@ -20,3 +20,3 @@ // watch mode does this and it's annoying to have the logs shunted around when

const ansiReset = /\x1Bc/g;
// Trim whitespace whilst preserving ANSI escape codes
// Trim newlines whilst preserving ANSI escape codes
function ansiTrim(message) {

@@ -37,3 +37,3 @@ let start = 0;

}
return (ansiStart.replace(whitespaceRegex, '') + message.slice(start, end) + ansiEnd.replace(whitespaceRegex, ''));
return ansiStart.replace('\n', '') + message.slice(start, end) + ansiEnd.replace('\n', '');
}

@@ -105,4 +105,6 @@ // Remove ANSI escape codes that mess with the terminal state. This selectively

// add the log level and wrap the message for the winston stream to
// consume
callback(null, { level, message: cleanupLogs(message) });
// consume. we preserve newlines here as, unlike other cases, this
// logger can be called in the middle of a line depending on when
// the stream is flushed.
callback(null, { level, message: stripAnsiReset(message) });
}

@@ -109,0 +111,0 @@ }))

{
"name": "@dotcom-tool-kit/logger",
"version": "4.0.0-beta.0",
"version": "4.0.0",
"description": "",

@@ -27,3 +27,3 @@ "main": "lib",

"@apaleslimghost/boxen": "^5.1.3",
"@dotcom-tool-kit/error": "4.0.0-beta.0",
"@dotcom-tool-kit/error": "^4.0.0",
"ansi-colors": "^4.1.1",

@@ -30,0 +30,0 @@ "ansi-regex": "^5.0.1",

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