Skip to content

Commit bb1f237

Browse files
committed
build: prevent replacing export names inside require paths
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 546d714 commit bb1f237

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/node_modules/@stdlib/_tools/scripts/create_namespace_types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ function create( fullPath ) {
382382
function onReplace( match ) {
383383
var RE;
384384

385-
// Only match the standalone identifier `mainExport[ 1 ]` (e.g., `ctor`):
386-
RE = new RegExp( '(^|[^a-zA-Z0-9_@])' + mainExport[ 1 ] + '(?![a-zA-Z0-9_])', 'g' );
385+
// Only match the standalone identifier `mainExport[ 1 ]` (e.g., `ctor`), but NOT inside require paths:
386+
RE = new RegExp( '(^|[^a-zA-Z0-9_@/])' + mainExport[ 1 ] + '(?![a-zA-Z0-9_])', 'g' );
387387
match = replace( match, RE, '$1' + name );
388388

389389
// Handle `new Name` constructor calls:

0 commit comments

Comments
 (0)