| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 64ce95b commit cf8701c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,9 @@ const { | |||
| 5 | 5 | RegExpPrototypeExec, | |
| 6 | 6 | decodeURIComponent, | |
| 7 | 7 | } = primordials; | |
| 8 | - const { kEmptyObject } = require('internal/util'); | ||
| 8 | + const { | ||
| 9 | + kEmptyObject, | ||
| 10 | + } = require('internal/util'); | ||
| 9 | 11 | ||
| 10 | 12 | const { defaultGetFormat } = require('internal/modules/esm/get_format'); | |
| 11 | 13 | const { validateAttributes, emitImportAssertionWarning } = require('internal/modules/esm/assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -477,6 +477,10 @@ function spliceOne(list, index) { | |||
| 477 | 477 | ||
| 478 | 478 | const kNodeModulesRE = /^(?:.*)[\\/]node_modules[\\/]/; | |
| 479 | 479 | ||
| 480 | + function isUnderNodeModules(filename) { | ||
| 481 | + return filename && (RegExpPrototypeExec(kNodeModulesRE, filename) !== null); | ||
| 482 | + } | ||
| 483 | + | ||
| 480 | 484 | let getStructuredStackImpl; | |
| 481 | 485 | ||
| 482 | 486 | function lazyGetStructuredStack() { | |
@@ -524,7 +528,7 @@ function isInsideNodeModules() { | |||
| 524 | 528 | ) { | |
| 525 | 529 | continue; | |
| 526 | 530 | } | |
| 527 | - return RegExpPrototypeExec(kNodeModulesRE, filename) !== null; | ||
| 531 | + return isUnderNodeModules(filename); | ||
| 528 | 532 | } | |
| 529 | 533 | } | |
| 530 | 534 | return false; | |
@@ -913,6 +917,7 @@ module.exports = { | |||
| 913 | 917 | isArrayBufferDetached, | |
| 914 | 918 | isError, | |
| 915 | 919 | isInsideNodeModules, | |
| 920 | + isUnderNodeModules, | ||
| 916 | 921 | join, | |
| 917 | 922 | lazyDOMException, | |
| 918 | 923 | lazyDOMExceptionClass, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments