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

@jepz20/conman

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jepz20/conman - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

yarn.lock

4

package.json
{
"name": "@jepz20/conman",
"version": "0.0.13",
"version": "0.0.14",
"description": "Configuration manager that supports ttl and plugabble sources",

@@ -17,3 +17,3 @@ "main": "./src/conman",

},
"gitHead": "520960b62d7a636a1a4c13d5933a06d2aefc852d",
"gitHead": "a1877d23a24042de10fa25296f519a3c681712f2",
"lint-staged": {

@@ -20,0 +20,0 @@ "src/**/*.*": [

@@ -14,7 +14,7 @@ # CONMAN

// Require conman
const Conman = require('@jepz20/conman');
const Conman = require('@highly-attractive-people/conman');
// Require the sources you will need in your config
const s3 = require('@jepz20/conman-s3-source');
const memory = require('@jepz20/conman-memory-source');
const s3 = require('@highly-attractive-people/conman-s3-source');
const memory = require('@highly-attractive-people/conman-memory-source');

@@ -21,0 +21,0 @@ // if your source requires it initialize it

@@ -29,10 +29,15 @@ const { mergeDeepRight } = require('ramda');

* @param {object} logger Object that atleast a log and error function
* @param logger.log Logs info
* @param logger.error Logs error
* @param {function} logger.log Logs info
* @param {function} logger.error Logs error
* @return {function(string, *)} Function that logs if enabled with the set logger
*/
function _log(isEnabled, logger) {
const fixedLogger = logger;
if (!logger.log && logger.info) {
fixedLogger.log = logger.info;
}
return function inner(type, ...args) {
if (isEnabled) {
logger[type](...args);
fixedLogger[type](...args);
}

@@ -39,0 +44,0 @@ };

@@ -249,2 +249,26 @@ jest.mock('jsonfile');

it('should use logger info if no logger log is provided', async () => {
const customLogger = {
info: jest.fn(),
error: jest.fn()
};
const options = {
logger: customLogger,
logEnabled: true,
useFile: false,
ttl: 0
};
const source1 = source({ test: 'test', test3: 'test3' });
jest.spyOn(source1, 'build');
const config = conman(options);
await config.addSource(source1).build();
expect(options.logger.info).toHaveBeenCalled();
expect(jsonfile.writeFile).toHaveBeenCalledTimes(0);
expect(jsonfile.readFile).toHaveBeenCalledTimes(0);
expect(source1.build).toHaveBeenCalledTimes(1);
});
it('should use the file if is NOT expired', async () => {

@@ -251,0 +275,0 @@ const source1 = source({ test: 'test', test3: 'test3' });

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