From 68ad85add160a49ddd4ebb4cbbf458b0a0390dd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 14:18:24 +0000 Subject: [PATCH] docs: use relative `require` path in `evalpoly-compile` example The automated JavaScript lint workflow on develop (run 26668990373) reported a `stdlib/require-last-path-relative` violation at line 23 in `@stdlib/math/base/tools/evalpoly-compile/examples/index.js`. The last `require()` call was `require('@stdlib/utils/try-require')`, a non-relative path. The file used the `tryRequire` pattern intended for packages with optional native addons. `evalpoly-compile` is pure JavaScript with no native dependencies, making the guard unnecessary. This commit replaces `tryRequire`-based loading with `require('./../lib')` and removes the unneeded `path` and `@stdlib/utils/try-require` imports, matching the pattern in sibling packages (e.g., `evalpoly`). Ref: https://github.com/stdlib-js/stdlib/actions/runs/26668990373 --- .../tools/evalpoly-compile/examples/index.js | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/examples/index.js b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/examples/index.js index 74c2c078cd22..1e43b76f0ec3 100644 --- a/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/examples/index.js +++ b/lib/node_modules/@stdlib/math/base/tools/evalpoly-compile/examples/index.js @@ -18,22 +18,12 @@ 'use strict'; -var resolve = require( 'path' ).resolve; var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var tryRequire = require( '@stdlib/utils/try-require' ); +var compile = require( './../lib' ); -var compile = tryRequire( resolve( __dirname, '..', 'lib' ) ); -if ( compile instanceof Error ) { - console.log( 'Unable to run example. Unsupported environment.' ); -} else { - main(); -} +// Create an array of random coefficients: +var coef = discreteUniform( 10, -100, 100 ); -function main() { - // Create an array of random coefficients: - var coef = discreteUniform( 10, -100, 100 ); - - // Compile a module for evaluating a polynomial: - var str = compile( coef ); - console.log( str ); -} +// Compile a module for evaluating a polynomial: +var str = compile( coef ); +console.log( str );