Socket
Socket
Sign inDemoInstall

@contrast/patcher

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/patcher - npm Package Compare versions

Comparing version 1.7.3 to 1.7.4

10

lib/index.js

@@ -242,3 +242,3 @@ /*

*
* @param {Object} obj the function or the object that contains the property/method we want to hook
* @param {Object} obj the object that contains the property/method we want to hook
* @param {string} prop the property/method of the object that we want to hook

@@ -249,7 +249,2 @@ * @param {Object} opts options for hooking

function hook(obj, prop, opts) {
// indicates object is a function and not an object with methods
if (!prop) {
return hookFunction(obj, opts);
}
const desc = getDescriptor(obj, prop);

@@ -350,3 +345,4 @@ if (desc.writable || desc.set) {

const fn = hook(obj, prop, options);
// if no property, hook a function directly.
const fn = prop ? hook(obj, prop, options) : hookFunction(obj, options);
const fnHooks = hooks.get(fn) || {

@@ -353,0 +349,0 @@ pre: new Map(),

{
"name": "@contrast/patcher",
"version": "1.7.3",
"version": "1.7.4",
"description": "Advanced monkey patching--registers hooks to run in and around functions",

@@ -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