From 3dea08a438267981c0b1e7cff2e5559a0b2cd14a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 24 May 2026 16:20:12 +0000 Subject: [PATCH] refactor: use `format` for error construction in `stats/incr/pcorrmat` Normalize a stray plain-string-concatenation throw at `lib/main.js:299` to use the `format` helper from `@stdlib/string/format`. The `format` import was already present and used by every other throw in the same file (six of seven) and by the analogous throw in sibling matrix packages `covmat` and `pcorrdistmat` (100% of throw-bearing matrix packages in `stats/incr`). Behavior is unchanged: the same `Error` is thrown with the same fields substituted; the surrounding text is preserved and the substituted values are wrapped in backticks to match the sibling pattern. --- lib/node_modules/@stdlib/stats/incr/pcorrmat/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/incr/pcorrmat/lib/main.js b/lib/node_modules/@stdlib/stats/incr/pcorrmat/lib/main.js index e70d8b578790..1b0a9a292eb8 100644 --- a/lib/node_modules/@stdlib/stats/incr/pcorrmat/lib/main.js +++ b/lib/node_modules/@stdlib/stats/incr/pcorrmat/lib/main.js @@ -296,7 +296,7 @@ function incrpcorrmat( out, means ) { throw new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray. Value: `%s`.', means ) ); } if ( numel( means.shape ) !== order ) { - throw new Error( 'invalid argument. The number of elements (means) in the second argument must match correlation matrix dimensions. Expected: '+order+'. Actual: '+numel( means.shape )+'.' ); + throw new Error( format( 'invalid argument. The number of elements (means) in the second argument must match correlation matrix dimensions. Expected: `%u`. Actual: `%u`.', order, numel( means.shape ) ) ); } mu = means; // TODO: should we copy this? Otherwise, internal state could be "corrupted" due to mutation outside the accumulator return accumulator2;