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

@magnetarjs/utils

Package Overview
Dependencies
Maintainers
3
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magnetarjs/utils - npm Package Compare versions

Comparing version 0.16.15 to 0.16.16

8

dist/index.d.ts

@@ -31,4 +31,10 @@ import { Clauses, EventFnSuccess } from '@magnetarjs/types';

declare function logWithFlair(message: string, ...args: any[]): void;
/**
* Logs to the console with `console.groupCollapsed` and colors.
*/
declare function logWithFlairGroup(title: string, nestedMessage: string, options?: {
preventLogFor: number;
}): void;
declare const logger: EventFnSuccess;
export { arrStr, countCharacter, filterDataPerClauses, isCollectionModule, isDocModule, isEven, isOdd, logWithFlair, logger, parseValueForFilters };
export { arrStr, countCharacter, filterDataPerClauses, isCollectionModule, isDocModule, isEven, isOdd, logWithFlair, logWithFlairGroup, logger, parseValueForFilters };

@@ -31,2 +31,3 @@ "use strict";

logWithFlair: () => logWithFlair,
logWithFlairGroup: () => logWithFlairGroup,
logger: () => logger,

@@ -180,9 +181,24 @@ parseValueForFilters: () => parseValueForFilters

var import_is_what3 = require("is-what");
var LOGGER_STYLE = "background: #0e0f15; color: #af98e6; border-radius: 4px; padding: 6px 10px; line-height: 2;";
function logWithFlair(message, ...args) {
console.info(
`%c\u{1F4AB} [magnetar] ${message}`,
"background: #0e0f15; color: #af98e6; border-radius: 4px; padding: 6px 10px;",
...args
);
console.info(`%c\u{1F4AB} [magnetar] ${message}`, LOGGER_STYLE, ...args);
}
var lastGroupLogTime = 0;
var lastGroupParams = null;
function shouldLog(params, preventLogFor) {
const now = Date.now();
if (now - lastGroupLogTime < preventLogFor && JSON.stringify(params) === JSON.stringify(lastGroupParams)) {
return false;
}
lastGroupLogTime = now;
lastGroupParams = params;
return true;
}
function logWithFlairGroup(title, nestedMessage, options) {
if (options && !shouldLog([title, nestedMessage], options.preventLogFor))
return;
console.groupCollapsed(`%c\u{1F4AB} [magnetar] ${title}`, LOGGER_STYLE);
console.log(nestedMessage);
console.groupEnd();
}
function stringifyQueryClause(q) {

@@ -231,4 +247,5 @@ return "or" in q ? `or(${q.or.map(

logWithFlair,
logWithFlairGroup,
logger,
parseValueForFilters
});

4

package.json
{
"name": "@magnetarjs/utils",
"version": "0.16.15",
"version": "0.16.16",
"sideEffects": false,

@@ -25,3 +25,3 @@ "description": "Magnetar utils like a logger for easier development",

"path-to-prop": "^2.0.4",
"@magnetarjs/types": "0.16.15"
"@magnetarjs/types": "0.16.16"
},

@@ -28,0 +28,0 @@ "keywords": [

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