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

roarr

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roarr - npm Package Compare versions

Comparing version 7.0.2 to 7.0.3

14

dist/src/factories/createLogger.js

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

const constants_1 = require("../constants");
let loggedWarning = false;
const globalThis = globalthis_1.default();

@@ -107,2 +108,15 @@ const getAsyncLocalContext = () => {

if (!asyncLocalStorage) {
if (loggedWarning === false) {
loggedWarning = true;
onMessage({
context: {
logLevel: constants_1.logLevels.warn,
package: 'roarr',
},
message: 'async_hooks are unavailable; Roarr.child will not function as expected',
sequence: getSequence(),
time: Date.now(),
version: config_1.ROARR_LOG_FORMAT_VERSION,
});
}
return routine();

@@ -109,0 +123,0 @@ }

6

dist/src/factories/createRoarrInitialGlobalState.js

@@ -35,9 +35,7 @@ "use strict";

};
// eslint-disable-next-line no-empty
}
catch (_a) {
// eslint-disable-next-line no-console
console.warn('async_hooks are unavailable; Roarr.child will not function as expected');
}
catch (_a) { }
}
return newState;
};

@@ -30,2 +30,29 @@ "use strict";

};
ava_1.serial('warns if async_hooks are unavailable', async (t) => {
const firstLog = createLoggerWithHistory();
const log = firstLog.child({
// Ensure that we are not adding context to the internal warning.
foo: 'bar',
});
globalThis.ROARR.asyncLocalStorage = null;
await log.adopt(
// eslint-disable-next-line @typescript-eslint/no-empty-function
() => { });
// Ensure that we log only once.
await log.adopt(
// eslint-disable-next-line @typescript-eslint/no-empty-function
() => { });
t.deepEqual(firstLog.messages, [
{
context: {
logLevel: 40,
package: 'roarr',
},
message: 'async_hooks are unavailable; Roarr.child will not function as expected',
sequence: '0',
time,
version,
},
]);
});
ava_1.serial('inherits context from async local scope', async (t) => {

@@ -32,0 +59,0 @@ const log = createLoggerWithHistory();

@@ -81,3 +81,3 @@ {

"typings": "./dist/src/Roarr.d.ts",
"version": "7.0.2"
"version": "7.0.3"
}
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