@contrast/instrumentation
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -17,2 +17,3 @@ /* | ||
const { StringPrototypeSubstring } = require('@contrast/common'); | ||
const { get } = require('./utils'); | ||
@@ -31,2 +32,8 @@ | ||
methods.forEach((method) => { | ||
const dotIdx = name.indexOf('.'); | ||
const firstName = dotIdx > -1 ? StringPrototypeSubstring.call(name, 0, dotIdx) : name; | ||
// check for whether the target on the module exists first to avoid these Node warnings: | ||
// (node:12155) Warning: Accessing non-existent property 'Server' of module exports inside circular dependency | ||
if (!(firstName in module)) return; | ||
const patchObj = get(module, name); | ||
@@ -33,0 +40,0 @@ if (!patchObj) return; |
@@ -17,3 +17,3 @@ /* | ||
const { split } = require('@contrast/common'); | ||
const { StringPrototypeSplit } = require('@contrast/common'); | ||
@@ -24,3 +24,3 @@ function get(obj, name) { | ||
let nest = obj; | ||
for (const prop of split(name, '.')) { | ||
for (const prop of StringPrototypeSplit.call(name, '.')) { | ||
nest = nest?.[prop]; | ||
@@ -27,0 +27,0 @@ if (nest === undefined) break; |
{ | ||
"name": "@contrast/instrumentation", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Shared hooks and patches between Protect and Assess components", | ||
@@ -14,3 +14,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"npm": ">=6.13.7 <7 || >= 8.3.1", | ||
"node": ">= 14.18.0" | ||
"node": ">= 16.9.1" | ||
}, | ||
@@ -21,4 +21,4 @@ "scripts": { | ||
"dependencies": { | ||
"@contrast/common": "1.21.0" | ||
"@contrast/common": "1.21.1" | ||
} | ||
} |
9425
220
+ Added@contrast/common@1.21.1(transitive)
- Removed@contrast/common@1.21.0(transitive)
Updated@contrast/common@1.21.1