Skip to content

Commit 4bfc499

Browse files
committed
docs: avoid module-scope name collision in _tools/pkgs/{dep-list,namespace-deps} examples
Renamed the JSDoc `@example` result variable from `deps`/`devDeps` to `out` so the example does not shadow the module-scope `var deps = require( './deps.js' );` import. Without this rename, the example-runner shadowed the internal `deps` function and threw `deps is not a function` when invoking the public function. https://claude.ai/code/session_018TZhAvyL3P8FYzhGm4G1LH
1 parent 84ef20b commit 4bfc499

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • lib/node_modules/@stdlib/_tools/pkgs

lib/node_modules/@stdlib/_tools/pkgs/dep-list/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ function ascending( a, b ) {
6262
* @returns {(StringArray|EmptyArray)} dependencies
6363
*
6464
* @example
65-
* var deps = depList( '@stdlib/assert/is-number-array' );
65+
* var out = depList( '@stdlib/assert/is-number-array' );
6666
* // returns [...]
6767
*
6868
* @example
6969
* var opts = {
7070
* 'dev': true
7171
* };
7272
*
73-
* var devDeps = depList( '@stdlib/utils/keys', opts );
73+
* var out = depList( '@stdlib/utils/keys', opts );
7474
* // returns [...]
7575
*/
7676
function depList( pkg, options ) {

lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ function ascending( a, b ) {
6262
* @returns {(StringArray|EmptyArray)} dependencies
6363
*
6464
* @example
65-
* var deps = namespaceDeps( '@stdlib/assert' );
65+
* var out = namespaceDeps( '@stdlib/assert' );
6666
* // returns [...]
6767
*
6868
* @example
6969
* var opts = {
7070
* 'dev': true
7171
* };
7272
*
73-
* var devDeps = namespaceDeps( '@stdlib/assert', opts );
73+
* var out = namespaceDeps( '@stdlib/assert', opts );
7474
* // returns [...]
7575
*/
7676
function namespaceDeps( pkg, options ) {

0 commit comments

Comments
 (0)