New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ulixee/commons

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ulixee/commons - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

10

cbor.js

@@ -1,9 +0,7 @@

const { decodeFirst, encodeCanonical } = require('cbor');
const { promisify } = require('util');
const { encodeOne, encodeCanonical, decodeFirst } = require('cbor');
const decodeFirstAsync = promisify(decodeFirst);
module.exports = {
decode: decodeFirstAsync,
encode: encodeCanonical,
encodeOne,
encodeCanonical,
decodeFirst,
};

10

errors.js

@@ -26,4 +26,5 @@ class UlixeeError extends Error {

class InvalidSignatureError extends UlixeeError {
constructor(message) {
constructor(message, details = {}) {
super(message, 'invalid::signature');
this.details = details;
}

@@ -88,2 +89,8 @@ }

class ClientError extends UlixeeError {
constructor(code, message) {
super(message, code);
}
}
module.exports = {

@@ -100,2 +107,3 @@ APIError,

InsufficientResourcesError,
ClientError,
};

@@ -8,10 +8,12 @@ const path = require('path');

const lockfileName = 'ulixee-lock.json';
const getDefaultLockFilePath = () => path.join(process.cwd(), lockfileName);
const getDefaultLockfilePath = () => path.join(process.cwd(), lockfileName);
class LockFile {
constructor(filePath) {
if (filePath) {
class Lockfile {
constructor(filePath, settings) {
if (filePath === 'virtual') {
this.lockfilePath = null;
} else if (filePath) {
this.lockfilePath = path.join(process.cwd(), filePath, lockfileName);
} else {
this.lockfilePath = getDefaultLockFilePath();
this.lockfilePath = getDefaultLockfilePath();
}

@@ -21,11 +23,14 @@ this.datatypes = {};

this.version = '0.0.1';
this.settings = {
escrowHost: '',
ledgerHost: '',
stakeHost: '',
bootstrapPeers: [],
decoderDirectory: 'decoder-scripts',
publicNodes: [],
};
this.load();
this.settings = Object.assign(
{
escrowHost: '',
ledgerHost: '',
stakeHost: '',
bootstrapPeers: [],
decoderDirectory: 'decoder-scripts',
publicNodes: [],
},
settings,
);
if (this.lockfilePath) this.load();
}

@@ -122,4 +127,13 @@

}
randomPublicHost() {
const randomIndex = Math.floor(Math.random() * this.settings.publicNodes.length);
const publicHost = this.settings.publicNodes[randomIndex];
if (!publicHost) {
throw new Error('No public nodes found. Use CLI to refresh the list of addresses.');
}
return publicHost;
}
}
module.exports = LockFile;
module.exports = Lockfile;

@@ -17,9 +17,14 @@ const { createLogger, transports, format } = require('winston');

const logMetaObject = get(info.metadata || {}, 'meta', {});
const logMeta = `${
Object.keys(logMetaObject).length ? `, ${JSON.stringify(logMetaObject, replacer, 2)}` : ''
}`;
return `${info.timestamp} ${meta.info.role || ''} [${info.label}] ${info.level}: ${
info.message
}${logMeta}`;
try {
const logMeta = `${
Object.keys(logMetaObject).length ? `, ${JSON.stringify(logMetaObject, replacer, 2)}` : ''
}`;
return `${info.timestamp} ${meta.info.role || ''} [${info.label}] ${info.level}: ${
info.message
}${logMeta}`;
} catch (error) {
console.log(new Error('error in printf:'));
console.log(info);
console.log(error);
}
});

@@ -26,0 +31,0 @@

{
"name": "@ulixee/commons",
"version": "0.0.1",
"version": "0.0.2",
"description": "Common utilities including crypto, network, logging, and others",

@@ -17,3 +17,3 @@ "main": "index.js",

},
"author": "blake",
"author": "The World",
"license": "ISC",

@@ -41,3 +41,3 @@ "bugs": {

"keywords": [],
"gitHead": "a0d220a88e392b3916c87e6ef9c8a875bc5a278f"
"gitHead": "fd922f15a16349e35ae70a7c6abf884d39db3a00"
}
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