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

@scalecube/utils

Package Overview
Dependencies
Maintainers
7
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalecube/utils - npm Package Compare versions

Comparing version 0.0.2-alpha.7 to 0.0.2-alpha.8

es/logs.d.ts

3

es/index.d.ts

@@ -5,2 +5,3 @@ import * as check from './check';

import { addWorker, removeWorker } from './connectWorkers';
export { check, getFullAddress, validateAddress, constants, getAddress, addWorker, removeWorker };
import { saveToLogs } from './logs';
export { check, getFullAddress, validateAddress, constants, getAddress, addWorker, removeWorker, saveToLogs };

@@ -187,2 +187,29 @@ var assert = function (predicate, msg) {

export { addWorker, check, constants, getAddress, getFullAddress, removeWorker, validateAddress };
var colorsMap = {};
var getRandomColor = function () {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
};
var saveToLogs = function (identifier, msg, extra, debug) {
if (!colorsMap[identifier]) {
colorsMap[identifier] = getRandomColor();
}
// tslint:disable
if (debug) {
var logColor = "color:" + colorsMap[identifier];
extra && console.log('%c************************', logColor);
console.log(msg);
extra &&
Object.keys(extra).forEach(function (key) {
console.log(key + ": " + JSON.stringify(extra[key], null, 4));
});
extra && console.log('%c************************', logColor);
}
// tslint:enable
};
export { addWorker, check, constants, getAddress, getFullAddress, removeWorker, saveToLogs, validateAddress };

@@ -5,2 +5,3 @@ import * as check from './check';

import { addWorker, removeWorker } from './connectWorkers';
export { check, getFullAddress, validateAddress, constants, getAddress, addWorker, removeWorker };
import { saveToLogs } from './logs';
export { check, getFullAddress, validateAddress, constants, getAddress, addWorker, removeWorker, saveToLogs };

@@ -191,2 +191,29 @@ 'use strict';

var colorsMap = {};
var getRandomColor = function () {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
};
var saveToLogs = function (identifier, msg, extra, debug) {
if (!colorsMap[identifier]) {
colorsMap[identifier] = getRandomColor();
}
// tslint:disable
if (debug) {
var logColor = "color:" + colorsMap[identifier];
extra && console.log('%c************************', logColor);
console.log(msg);
extra &&
Object.keys(extra).forEach(function (key) {
console.log(key + ": " + JSON.stringify(extra[key], null, 4));
});
extra && console.log('%c************************', logColor);
}
// tslint:enable
};
exports.addWorker = addWorker;

@@ -198,2 +225,3 @@ exports.check = check;

exports.removeWorker = removeWorker;
exports.saveToLogs = saveToLogs;
exports.validateAddress = validateAddress;
{
"name": "@scalecube/utils",
"version": "0.0.2-alpha.7",
"version": "0.0.2-alpha.8",
"private": false,

@@ -37,5 +37,5 @@ "main": "lib/index.js",

"dependencies": {
"@scalecube/api": "^0.0.2-alpha.7"
"@scalecube/api": "^0.0.2-alpha.8"
},
"gitHead": "ae962d62c4deb8016761bc7e0c9a1c6aac1648e2"
"gitHead": "e2f5e84083dbfd8a5c15f465c191335dc539472b"
}
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