Socket
Socket
Sign inDemoInstall

console-stamp

Package Overview
Dependencies
7
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.1 to 3.1.2

37

lib/utils.js

@@ -49,8 +49,11 @@ const df = require( './defaults' );

prefix = prefix.replace( re, ( match, params ) => {
let ret = token( { method, defaultTokens, params: parseParams( params ), tokens, msg } );
match.replace( params, '' ).split( '.' ).slice( 1 ).forEach( decorator => {
ret = chalk`{${decorator} ${ret}}`;
} );
return ret;
try {
let ret = token({method, defaultTokens, params: parseParams(params), tokens, msg});
match.replace(params, '').split('.').slice(1).forEach(decorator => {
ret = chalk`{${decorator} ${ret}}`;
});
return ret;
}catch (e){
return match;
}
} );

@@ -61,9 +64,17 @@ } );

const rec = /(\([^)]*\))(\.\w+)+/g;
prefix = prefix.replace( rec, ( match, text ) => {
let ret = text.replace( /[\(\)]/g, '' );
match.replace( text, '' ).split( '.' ).slice( 1 ).forEach( decorator => {
ret = chalk`{${decorator} ${ret}}`;
} );
return ret;
} )
if(/(\([^)]*\))(\.\w+)/.test(prefix.replace(msg,''))){ // If there is a color group in the prefix
prefix = prefix.replace(rec, (match, text) => {
try {
let ret = text.replace(/[()]/g, '');
match.replace(text, '').split('.').slice(1).forEach(decorator => {
ret = chalk`{${decorator} ${ret}}`;
});
return ret;
} catch (e) {
return match;
}
});
}
return prefix;

@@ -70,0 +81,0 @@ }

{
"name": "console-stamp",
"main": "index.js",
"version": "3.1.1",
"version": "3.1.2",
"scripts": {

@@ -6,0 +6,0 @@ "test": "tap --no-check-coverage -R spec test/*.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc