diff --git a/lib/ticks-to-tree.js b/lib/ticks-to-tree.js index deb7392..7559ccf 100644 --- a/lib/ticks-to-tree.js +++ b/lib/ticks-to-tree.js @@ -4,8 +4,9 @@ const { spawnSync } = require('child_process') const { join } = require('path') const debug = require('debug')('0x: ticks-to-tree') const assert = require('assert') +const escape = require('escape-string-regexp') -const preloadDirRx = RegExp(join(__dirname, 'preload')) +const preloadDirRx = RegExp(join(escape(__dirname), 'preload')) const internalModuleRegExp = /^.?(?:\(anonymous\)|internalBinding|NativeModule[^ ]*) [^/\\][a-zA-Z0-9_/\\-]+\.js:\d+:\d+$/ const nodeBootstrapRegExp = / internal\/bootstrap.+\.js:\d+:\d+$/ diff --git a/package.json b/package.json index e518208..434e5d2 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "debug": "^4.0.1", "end-of-stream": "^1.1.0", "env-string": "^1.0.0", + "escape-string-regexp": "^1.0.5", "execspawn": "^1.0.1", "has-unicode": "^2.0.1", "hsl-to-rgb-for-reals": "^1.1.0",