Skip to content

Commit c6eb208

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into pr/headlessNode/8110
2 parents a275e39 + f84c1a6 commit c6eb208

File tree

313 files changed

+35301
-1160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+35301
-1160
lines changed

.github/workflows/namespace_declarations.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ jobs:
6565
# Specify whether to download Git-LFS files:
6666
lfs: false
6767

68-
# Avoid storing GitHub token in local Git configuration:
69-
persist-credentials: false
68+
# Provide a GitHub token for authentication
69+
token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
70+
71+
# Store GitHub token in local Git configuration:
72+
persist-credentials: true
7073
timeout-minutes: 10
7174

7275
# Install Node.js:
@@ -107,7 +110,11 @@ jobs:
107110
# Process each namespace:
108111
while IFS= read -r namespace; do
109112
if [ -n "$namespace" ] && [[ $namespace != *"_tools"* ]]; then
110-
branch_name="update-$(echo "$namespace" | sed 's/@stdlib\///' | sed 's/\//-/g')-declarations"
113+
# Namespace without the '@stdlib/' scope for display in commit messages and PR titles:
114+
display_namespace="${namespace#@stdlib/}"
115+
116+
# Branch name slug with slashes replaced by dashes:
117+
branch_name="update-${display_namespace//\//-}-declarations"
111118
git checkout -b "$branch_name"
112119
113120
# Generate declarations for this namespace:
@@ -119,13 +126,13 @@ jobs:
119126
git add lib/node_modules/@stdlib
120127
121128
# Commit changes:
122-
git commit -m "feat: update \`${namespace}\` TypeScript declarations" --signoff
129+
git commit -m "feat: update \`${display_namespace}\` TypeScript declarations" --signoff
123130
124131
# Push branch and create PR:
125132
git push origin "$branch_name"
126133
127134
gh pr create \
128-
--title "feat: update \`${namespace}\` TypeScript declarations" \
135+
--title "feat: update \`${display_namespace}\` TypeScript declarations" \
129136
--body "This PR updates TypeScript declarations for the \`${namespace}\` namespace.
130137
131138
## Reviewer Checklist
@@ -138,7 +145,7 @@ jobs:
138145
- [ ] Approve the PR once you are confident about the classification and changes made." \
139146
--label "Documentation" \
140147
--label "automated-pr" \
141-
--reviewer "reviewers" \
148+
--reviewer "@stdlib-js/reviewers" \
142149
--base develop \
143150
--head "$branch_name"
144151
fi

lib/node_modules/@stdlib/_tools/scripts/create_namespace_types.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ function create( fullPath ) {
301301
var RE;
302302

303303
match = replace( match, mainExport[ 1 ], name );
304-
RE = new RegExp( '([^a-zA-Z@])'+name, 'g' );
305-
return replace( match, RE, '$1ns.'+name );
304+
305+
// Only match the standalone identifier `name`:
306+
RE = new RegExp( '(^|[^a-zA-Z0-9_@])' + name + '(?![a-zA-Z0-9_])', 'g' );
307+
return replace( match, RE, '$1ns.' + name );
306308
}
307309
}
308310

lib/node_modules/@stdlib/array/base/assert/docs/types/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/* eslint-disable max-lines */
2222

2323
import contains = require( '@stdlib/array/base/assert/contains' );
24+
import hasAlmostEqualValues = require( '@stdlib/array/base/assert/has-almost-equal-values' );
2425
import hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' );
2526
import hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' );
2627
import hasSameValues = require( '@stdlib/array/base/assert/has-same-values' );
@@ -73,6 +74,27 @@ interface Namespace {
7374
*/
7475
contains: typeof contains;
7576

77+
/**
78+
* Tests if two arrays have respective elements which are approximately equal within a specified number of ULPs (units in the last place).
79+
*
80+
* ## Notes
81+
*
82+
* - If provided arrays of unequal length, the function returns `false`.
83+
*
84+
* @param x - first input array
85+
* @param y - second input array
86+
* @param maxULP - maximum allowed ULP difference
87+
* @returns boolean indicating whether both arrays are approximately equal
88+
*
89+
* @example
90+
* var x = [ 0, 0, 1, 0 ];
91+
* var y = [ 0, 0, 1, 0 ];
92+
*
93+
* var out = ns.hasAlmostEqualValues( x, y, 0 );
94+
* // returns true
95+
*/
96+
hasAlmostEqualValues: typeof hasAlmostEqualValues;
97+
7698
/**
7799
* Tests if two arrays have equal values.
78100
*

lib/node_modules/@stdlib/array/base/banded/docs/types/index.d.ts

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,63 @@
2121
/* eslint-disable max-lines */
2222

2323
import filled2dBy = require( '@stdlib/array/base/banded/filled2d-by' );
24+
import toCompact = require( '@stdlib/array/base/banded/to-compact' );
2425

2526
/**
26-
* Interface describing a namespace.
27+
* Interface describing the `banded` namespace.
2728
*/
2829
interface Namespace {
2930
/**
30-
* TODO
31+
* Returns a filled two-dimensional banded nested array according to a provided callback function.
32+
*
33+
* @param shape - array shape
34+
* @param ku - number of super-diagonals
35+
* @param kl - number of sub-diagonals
36+
* @param fill - fill value for values outside the band
37+
* @param clbk - callback function
38+
* @param thisArg - callback function execution context
39+
* @returns output array
40+
*
41+
* @example
42+
* function clbk( indices ) {
43+
* return indices[ 0 ] + indices[ 1 ];
44+
* }
45+
*
46+
* var out = ns.filled2dBy( [ 3, 3 ], 1, 1, 0, clbk );
47+
* // returns [ [ 0, 1, 0 ], [ 1, 2, 3 ], [ 0, 3, 4 ] ]
3148
*/
3249
filled2dBy: typeof filled2dBy;
50+
51+
/**
52+
* Converts a two-dimensional banded nested array to compact banded storage.
53+
*
54+
* @param arr - input two-dimensional array
55+
* @param ku - number of super-diagonals
56+
* @param kl - number of sub-diagonals
57+
* @param colexicographic - specifies whether to store diagonals in colexicographic access order
58+
* @returns output array
59+
*
60+
* @example
61+
* var M = [
62+
* [ 11, 2, 0 ],
63+
* [ 3, 12, 4 ],
64+
* [ 0, 5, 13 ]
65+
* ];
66+
*
67+
* var out = ns.toCompact( M, 1, 1, false );
68+
* // returns [ [ 0, 2, 4 ], [ 11, 12, 13 ], [ 3, 5, 0 ] ]
69+
*
70+
* @example
71+
* var M = [
72+
* [ 11, 2, 0 ],
73+
* [ 3, 12, 4 ],
74+
* [ 0, 5, 13 ]
75+
* ];
76+
*
77+
* var out = ns.toCompact( M, 1, 1, true );
78+
* // returns [ [ 0, 11, 3 ], [ 2, 12, 5 ], [ 4, 13, 0 ] ]
79+
*/
80+
toCompact: typeof toCompact;
3381
}
3482

3583
/**

lib/node_modules/@stdlib/array/base/bifurcate-entries/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type Results<T> = [ Array<[ number, T ]>, Array<[ number, T ]> ];
3838
* var x = [ 'beep', 'boop', 'foo', 'bar' ];
3939
* var filter = [ true, true, false, true ];
4040
*
41-
* var out = bifurcateEntries( arr, filter );
41+
* var out = bifurcateEntries( x, filter );
4242
* // returns [ [ [ 0, 'beep' ], [ 1, 'boop' ], [ 3, 'bar' ] ], [ [ 2, 'foo' ] ] ]
4343
*/
4444
declare function bifurcateEntries<T = unknown>( x: Collection<T> | AccessorArrayLike<T>, filter: Collection | AccessorArrayLike<any> ): Results<T>; // eslint-disable-line @typescript-eslint/no-explicit-any

lib/node_modules/@stdlib/array/base/bifurcate-values/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Collection, AccessorArrayLike } from '@stdlib/types/array';
3333
* var x = [ 'beep', 'boop', 'foo', 'bar' ];
3434
* var filter = [ true, true, false, true ];
3535
*
36-
* var out = bifurcateValues( arr, filter );
36+
* var out = bifurcateValues( x, filter );
3737
* // returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
3838
*/
3939
declare function bifurcateValues<T = unknown>( x: Collection<T> | AccessorArrayLike<T>, filter: Collection | AccessorArrayLike<any> ): [ Array<T>, Array<T> ]; // eslint-disable-line @typescript-eslint/no-explicit-any

lib/node_modules/@stdlib/array/base/broadcasted-ternary5d/docs/types/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ type InOutShapes = [
8888
* var ones5d = require( '@stdlib/array/base/ones5d' );
8989
* var zeros5d = require( '@stdlib/array/base/zeros5d' );
9090
* var add = require( '@stdlib/number/float64/base/add3' );
91-
* var bternary5d = require( '@stdlib/array/base/broadcasted-ternary5d' );
9291
* var shapes = [
9392
* [ 1, 2, 1, 1, 1 ],
9493
* [ 2, 1, 1, 1, 1 ],

lib/node_modules/@stdlib/array/base/cunone-by-right/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ interface CunoneByRight {
8080
*
8181
* @example
8282
* function fcn( v ) {
83-
* return v > 0;
83+
* return v > 0;
8484
* }
8585
* var x = [ 0, 1, 1, 0, 0 ];
8686
*
@@ -102,7 +102,7 @@ interface CunoneByRight {
102102
*
103103
* @example
104104
* function fcn( v ) {
105-
* return v > 0;
105+
* return v > 0;
106106
* }
107107
* var x = [ 1, 1, 0, 0, 0 ];
108108
* var y = [ false, null, false, null, false, null, false, null, false, null ];
@@ -158,7 +158,7 @@ interface CunoneByRight {
158158
* var x = [ 0, 0, 0, 1, 0 ];
159159
* var y = [ false, null, false, null, false, null, false, null, false, null ];
160160
*
161-
* var arr = cunoneBy.assign( x, y, 2, 0, isPositive );
161+
* var arr = cunoneByRight.assign( x, y, 2, 0, isPositive );
162162
* // returns [ true, null, false, null, false, null, false, null, false, null ]
163163
*/
164164
assign<T = unknown, U = unknown, V = unknown>( x: Collection<T> | AccessorArrayLike<T>, out: Collection<U> | AccessorArrayLike<U>, stride: number, offset: number, predicate: Predicate<T, V>, thisArg?: ThisParameterType<Predicate<T, V>> ): Collection<U | boolean> | AccessorArrayLike<U | boolean>;
@@ -174,16 +174,16 @@ interface CunoneByRight {
174174
*
175175
* @example
176176
* function fcn( v ) {
177-
* return v > 0;
177+
* return v > 0;
178178
* }
179179
* var x = [ 1, 1, 0, 0, 0 ];
180180
*
181-
* var result = cunoneByright( x, fcn );
181+
* var result = cunoneByRight( x, fcn );
182182
* // returns [ true, true, true, false, false ]
183183
*
184184
* @example
185185
* function fcn( v ) {
186-
* return v > 0;
186+
* return v > 0;
187187
* }
188188
* var x = [ 0, 1, 1, 0, 0 ];
189189
* var y = [ false, null, false, null, false, null, false, null, false, null ];

0 commit comments

Comments
 (0)