From a87352d3f7b530ccf686337f40c4c5e9a1942883 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Jul 2026 14:13:49 +0000 Subject: [PATCH] fix(@stdlib/_tools/repl-txt/rules/doctest): guard against null `alias` in `replaceAliases` The job `Lint Changed Files` on workflow `lint_changed_files` failed on develop with `TypeError: Cannot read properties of null (reading 'split')` in `replaceAliases`. Root cause: `pkg2alias()` returns `null` when a referenced package is not yet indexed in the generated `@stdlib/namespace` registry, which happens when a `repl.txt` file references a sibling package added in the same commit, before the `namespace_declarations` workflow regenerates the registry. The unguarded call site called `.split('.')` directly on that `null`. This commit falls back to `'ALIAS'` on a falsy return, mirroring the identical guard already used earlier in the same file (`pkgName = pkg2alias( pkg ) || 'ALIAS';`) and the resolvable-aliases rule's null handling, so the lint job no longer crashes on newly added cross-referencing sibling packages. Ref: https://github.com/stdlib-js/stdlib/actions/runs/29314039197 --- .../@stdlib/_tools/repl-txt/rules/doctest/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js b/lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js index 64b64e6151ee..b775d0e6b3cc 100644 --- a/lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js @@ -171,7 +171,7 @@ function main( context ) { var o; var i; - alias = pkg2alias( pkg ); + alias = pkg2alias( pkg ) || 'ALIAS'; alias = alias.split( '.' ); len = alias.length;