From 1dc1206ab4ef4b575e654bba1a2db82ab170df11 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 31 May 2026 14:17:09 +0000 Subject: [PATCH] docs(@stdlib/math/base/tools/evalpoly-compile): use relative require path in example The `lint_random_files` workflow (develop, 2026-05-30T00:34 UTC, run 26668990373) flagged `stdlib/require-last-path-relative` at line 23 of `evalpoly-compile/examples/index.js`. The last `require()` call in AST order was `require('@stdlib/utils/try-require')`, a non-relative path. The `evalpoly-compile` package is pure JavaScript: no `binding.gyp`, no native source, and empty `dependencies`/`devDependencies`. The `tryRequire` guard was included by analogy with native addon packages but is unnecessary here. Replacing it with a direct `require('./../lib')` aligns the example with the sibling `evalpoly` package and satisfies the lint rule. 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 );