Socket
Socket
Sign inDemoInstall

@contrast/deadzones

Package Overview
Dependencies
Maintainers
0
Versions
16
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.2.3 to 1.2.4

52

lib/install/bson.js

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

// module.exports = function(core) {
// return core.deadzones.bsonInstrumentation = {
// install() {},
// uninstall() {}
// };
// };
// the following is being left in place in case we need to instrument bson
// in the future. Notes:
// - v1 the export is a constructor.
// - has no dependencies.
// - v4-6 the export is an object with serialize and deserialize methods
// - v4 - has one dependency: buffer
// - buffer has two dependencies: base64-js, ieee754. neither has deps.
// - base64-js could be deadzoned, but does most manipulation via
// charCodeAt(), so minimal impact of rewriting.
// - ieee754 reads/write FP numbers in buffers. minimal impact.
// - v5,6 - no dependencies
// - starting with v5, it's no longer possible to require('bson/package.json')
// - there is no performance improvement from this runtime deadzoning for any
// version. 100% of the improvement comes from not-rewriting the bson
// module.
//*
const { patchType } = require('../common');

@@ -30,5 +54,6 @@

install() {
const moduleName = 'bson';
depHooks.resolve({ name: moduleName }, (xport) => {
depHooks.resolve({ name: moduleName, version: '>=4.0.0' }, (xport) => {
[

@@ -47,2 +72,26 @@ 'serialize',

});
depHooks.resolve({ name: moduleName, version: '>1.0.0 <2.0.0' }, (xport) =>
// the xport is a constructor which returns an object with serialize
// and deserialize methods.
patcher.patch(xport, {
name: `${moduleName}.constructor`,
patchType,
post({ result: bson }) {
// the constructor returns undefined if called without `new`
if (!bson) {
return;
}
['serialize', 'deserialize'].forEach((methodName) => {
const patchName = `${moduleName}.${methodName}`;
const store = { lock: true, name: patchName };
patcher.patch(bson, methodName, {
name: patchName,
patchType,
around: createAroundHook(store),
});
});
}
})
);
},

@@ -52,1 +101,2 @@ uninstall() { }

};
// */

2

package.json
{
"name": "@contrast/deadzones",
"version": "1.2.3",
"version": "1.2.4",
"description": "Configures Contrast agent services and instrumentation within an application",

@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE",

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