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

@contrast/deadzones

Package Overview
Dependencies
Maintainers
9
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/deadzones - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

lib/install/@cyclonedx.js

46

lib/index.js

@@ -18,2 +18,11 @@ /*

const { callChildComponentMethodsSync } = require('@contrast/common');
/**
* @param {{
* scopes: {
* instrumentation: import('@contrast/scopes').Instrumentation
* }
* }} core
*/
module.exports = function(core) {

@@ -35,30 +44,25 @@ const {

createAroundHook,
installers: [],
};
const consoleDeadzone = require('./install/console')(core);
const moduleDeadzones = require('./install/module')(core);
require('./install/@cyclonedx')(core);
require('./install/console')(core);
require('./install/coffeescript')(core);
require('./install/babel')(core);
require('./install/bson')(core);
require('./install/iconv-lite')(core);
require('./install/jsrsasign')(core);
require('./install/less')(core);
require('./install/module')(core);
require('./install/pino')(core);
require('./install/type-is')(core);
deadzones.install = function() {
consoleDeadzone.install();
moduleDeadzones.install();
// logger isn't a dependency of deadzones so check if it has been composed
if (core.logger) {
for (const level of ['trace', 'debug', 'info', 'warn', 'error']) {
const store = { lock: true, name: `core.logger.${level}` };
const boundMethod = core.logger[level].bind(core.logger);
core.logger[level] = function(...args) {
if (!instrumentation.isLocked()) {
return instrumentation.run(store, boundMethod, ...args);
}
return boundMethod(...args);
};
}
}
callChildComponentMethodsSync(deadzones, 'install');
};
deadzones.uninstall = function() {
consoleDeadzone.uninstall();
moduleDeadzones.uninstall();
for (const installer of deadzones.installers) {
installer.uninstall?.();
}
};

@@ -65,0 +69,0 @@

@@ -24,3 +24,2 @@ /*

patcher,
deadzones,
deadzones: {

@@ -31,13 +30,10 @@ createAroundHook,

const name = 'Module.prototype.require';
const store = {
name: `${name}`,
lock: true,
};
return core.deadzones.moduleInstrumentation = {
install() {
const patchName = 'Module.prototype.require';
const store = { lock: true, name: patchName };
return deadzones.moduleInstrumentation = {
install() {
// `require` has sinks and propagators that run
patcher.patch(Module.prototype, 'require', {
name,
name: patchName,
patchType,

@@ -44,0 +40,0 @@ around: createAroundHook(store),

{
"name": "@contrast/deadzones",
"version": "1.1.3",
"version": "1.2.0",
"description": "Configures Contrast agent services and instrumentation within an application",

@@ -18,3 +18,6 @@ "license": "SEE LICENSE IN LICENSE",

"test": "../scripts/test.sh"
},
"dependencies": {
"@contrast/common": "1.21.0"
}
}
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