Skip to content

Commit 728004d

Browse files
committed
hide implementation detail of regexp-escape bundle
1 parent 8a6fc0d commit 728004d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

loader-hook.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import regexpEscape from './packages/node_modules/escape-string-regexp/index.js'
1+
import regexpEscapeModule from './packages/node_modules/escape-string-regexp/index.js'
22
import * as iitm from 'import-in-the-middle/hook.mjs'
33
import hooks from './packages/datadog-instrumentations/src/helpers/hooks.js'
44
import configHelper from './packages/dd-trace/src/config-helper.js'
55

6+
const regexpEscape = regexpEscapeModule.default
7+
68
// For some reason `getEnvironmentVariable` is not otherwise available to ESM.
79
const env = configHelper.getEnvironmentVariable
810

@@ -33,7 +35,7 @@ function addSecurityControls (data) {
3335
.map(sc => sc.trim())
3436

3537
for (const subpath of securityControls) {
36-
data.include.push(new RegExp(regexpEscape.default(subpath)))
38+
data.include.push(new RegExp(regexpEscape(subpath)))
3739
}
3840
}
3941

0 commit comments

Comments
 (0)