Skip to content

Commit 8db6406

Browse files
committed
Auto-generated commit
1 parent 3a377ef commit 8db6406

File tree

17 files changed

+1877
-3
lines changed

17 files changed

+1877
-3
lines changed

CHANGELOG.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-03-18)
7+
## Unreleased (2025-03-22)
88

99
<section class="packages">
1010

@@ -64,6 +64,7 @@
6464

6565
##### Features
6666

67+
- [`a612b3d`](https://github.com/stdlib-js/stdlib/commit/a612b3dee234a1218596793d2d3be311154eb799) - add `fillBy` to namespace
6768
- [`e661213`](https://github.com/stdlib-js/stdlib/commit/e66121352ef767cdb87d19e938b1eccf7970fa3a) - update namespace TypeScript declarations [(#4706)](https://github.com/stdlib-js/stdlib/pull/4706)
6869
- [`04f5785`](https://github.com/stdlib-js/stdlib/commit/04f5785ed011a7b0701eba10274cf4308f16bbad) - add `scatterFilled` to namespace
6970
- [`5682699`](https://github.com/stdlib-js/stdlib/commit/56826996a6bc1179b9b99e33f81c814100a8fb78) - add `scattered` to namespace
@@ -469,6 +470,38 @@ This release closes the following issue:
469470

470471
<!-- /.features -->
471472

473+
<section class="bug-fixes">
474+
475+
##### Bug Fixes
476+
477+
- [`09ff0ce`](https://github.com/stdlib-js/stdlib/commit/09ff0ce53ae1c659591a4106c7f44b9df29bcdfd) - add missing index normalization and add associated tests
478+
479+
</section>
480+
481+
<!-- /.bug-fixes -->
482+
483+
</details>
484+
485+
</section>
486+
487+
<!-- /.package -->
488+
489+
<section class="package" id="array-base-fill-by-unreleased">
490+
491+
#### [@stdlib/array/base/fill-by](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/fill-by)
492+
493+
<details>
494+
495+
<section class="features">
496+
497+
##### Features
498+
499+
- [`ab96811`](https://github.com/stdlib-js/stdlib/commit/ab968115af31dba0958736eeb1fc1fd73903c16c) - add `array/base/fill-by`
500+
501+
</section>
502+
503+
<!-- /.features -->
504+
472505
</details>
473506

474507
</section>
@@ -1283,6 +1316,12 @@ A total of 13 people contributed to this release. Thank you to the following con
12831316

12841317
<details>
12851318

1319+
- [`a612b3d`](https://github.com/stdlib-js/stdlib/commit/a612b3dee234a1218596793d2d3be311154eb799) - **feat:** add `fillBy` to namespace _(by Athan Reines)_
1320+
- [`ab96811`](https://github.com/stdlib-js/stdlib/commit/ab968115af31dba0958736eeb1fc1fd73903c16c) - **feat:** add `array/base/fill-by` _(by Athan Reines)_
1321+
- [`b41b329`](https://github.com/stdlib-js/stdlib/commit/b41b329153af54747648343fe20907feecac2639) - **test:** add tests _(by Athan Reines)_
1322+
- [`1f692ff`](https://github.com/stdlib-js/stdlib/commit/1f692ffb74ca5c9f27092829f71f8bc279edd5b7) - **docs:** add note and fix note _(by Athan Reines)_
1323+
- [`da6bf00`](https://github.com/stdlib-js/stdlib/commit/da6bf00e5a133d6cff6afc6c18c8a60a2e750a3d) - **docs:** add note _(by Athan Reines)_
1324+
- [`09ff0ce`](https://github.com/stdlib-js/stdlib/commit/09ff0ce53ae1c659591a4106c7f44b9df29bcdfd) - **fix:** add missing index normalization and add associated tests _(by Athan Reines)_
12861325
- [`9b2b107`](https://github.com/stdlib-js/stdlib/commit/9b2b10706d20bf18b5a862b0be1c3c53be30c9ce) - **feat:** add `array/base/map` [(#5346)](https://github.com/stdlib-js/stdlib/pull/5346) _(by Muhammad Haris, Athan Reines)_
12871326
- [`3938b26`](https://github.com/stdlib-js/stdlib/commit/3938b265e603116448c89fcaa58df70e79d40f59) - **refactor:** update paths _(by Gururaj Gurram)_
12881327
- [`ef1d278`](https://github.com/stdlib-js/stdlib/commit/ef1d278f2a382993d2cc63f83458778593767708) - **feat:** add `array/base/banded/to-compact` _(by Athan Reines)_

CONTRIBUTORS

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Aadish Jain <[email protected]>
66
Aayush Khanna <[email protected]>
77
Abdelrahman Samir <[email protected]>
8+
Abdul Kaium <[email protected]>
89
Abhay Punia <[email protected]>
910
Abhijit Raut <[email protected]>
1011
Abhishek Jain <[email protected]>
@@ -16,6 +17,7 @@ Ahmed Khaled <[email protected]>
1617
Aksshay Balasubramanian <[email protected]>
1718
Aleksandr <[email protected]>
1819
Ali Salesi <[email protected]>
20+
AlyAbdelmoneim <[email protected]>
1921
Aman Bhansali <[email protected]>
2022
AmanBhadkariya <[email protected]>
2123
Amit Jimiwal <[email protected]>
@@ -24,6 +26,7 @@ Anshu Kumar <[email protected]>
2426
Anudeep Sanapala <[email protected]>
2527
Athan Reines <[email protected]>
2628
29+
Bhavishy Agrawal <[email protected]>
2730
Brendan Graetz <[email protected]>
2831
Bruno Fenzl <[email protected]>
2932
Bryan Elee <[email protected]>
@@ -61,6 +64,7 @@ Jaimin Godhani <[email protected]>
6164
Jaison D Souza <[email protected]>
6265
Jalaj Kumar <[email protected]>
6366
James Gelok <[email protected]>
67+
6468
Jaysukh Makvana <[email protected]>
6569
Jenish Thapa <[email protected]>
6670
Jithin KS <[email protected]>
@@ -78,6 +82,7 @@ Krishnam Agarwal <[email protected]>
7882
Krishnendu Das <[email protected]>
7983
Kshitij-Dale <[email protected]>
8084
Lovelin Dhoni J B <[email protected]>
85+
8186
Manik Sharma <[email protected]>
8287
Manvith M <[email protected]>
8388
Marcus Fantham <[email protected]>
@@ -107,7 +112,9 @@ Pratik Singh <[email protected]>
107112
Pratyush Kumar Chouhan <[email protected]>
108113
Priyansh Prajapati <[email protected]>
109114
Priyanshu Agarwal <[email protected]>
115+
Pulkit Gupta <[email protected]>
110116
Pushpendra Chandravanshi <[email protected]>
117+
Rahul Kumar <[email protected]>
111118
Raunak Kumar Gupta <[email protected]>
112119
Rejoan Sardar <[email protected]>
113120
Ricky Reusser <[email protected]>
@@ -122,6 +129,7 @@ Ryan Seal <[email protected]>
122129
Rylan Yang <[email protected]>
123130
SHIVAM YADAV <[email protected]>
124131
Sai Srikar Dumpeti <[email protected]>
132+
Sanchay Ketan Sinha <[email protected]>
125133
Sarthak Paandey <[email protected]>
126134
Saurabh Singh <[email protected]>
127135
Seyyed Parsa Neshaei <[email protected]>

base/fill-by/README.md

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# fillBy
22+
23+
> Fill all elements within a portion of an array according to a callback function.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var fillBy = require( '@stdlib/array/base/fill-by' );
41+
```
42+
43+
#### fillBy( x, start, end, fcn\[, thisArg] )
44+
45+
Fills all elements within a portion of an array from an inclusive `start` index to an exclusive `end` index according to a provided callback function.
46+
47+
```javascript
48+
function fcn() {
49+
return 10;
50+
}
51+
52+
var x = [ 1, 2, 3, 4, 5, 6 ];
53+
54+
var out = fillBy( x, 1, 4, fcn );
55+
// returns [ 1, 10, 10, 10, 5, 6 ]
56+
57+
var bool = ( out === x );
58+
// returns true
59+
```
60+
61+
The callback function is provided the following arguments:
62+
63+
- **value**: current array element.
64+
- **index**: current array element index.
65+
- **arr**: input array.
66+
67+
To set the callback execution context, provide a `thisArg`.
68+
69+
<!-- eslint-disable no-invalid-this -->
70+
71+
```javascript
72+
function fcn() {
73+
this.count += 1;
74+
return 10;
75+
}
76+
77+
var x = [ 1, 2, 3, 4, 5, 6 ];
78+
79+
var ctx = {
80+
'count': 0
81+
};
82+
var out = fillBy( x, 1, 4, fcn, ctx );
83+
// returns [ 1, 10, 10, 10, 5, 6 ]
84+
85+
var bool = ( out === x );
86+
// returns true
87+
88+
var cnt = ctx.count;
89+
// returns 3
90+
```
91+
92+
</section>
93+
94+
<!-- /.usage -->
95+
96+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
97+
98+
<section class="notes">
99+
100+
## Notes
101+
102+
- Negative `start` and `end` indices are resolved to positive indices by counting from the end of the array with `-1` corresponding to the last indexed element.
103+
- The function **mutates** the input array.
104+
105+
</section>
106+
107+
<!-- /.notes -->
108+
109+
<!-- Package usage examples. -->
110+
111+
<section class="examples">
112+
113+
## Examples
114+
115+
<!-- eslint no-undef: "error" -->
116+
117+
```javascript
118+
var constantFunction = require( '@stdlib/utils/constant-function' );
119+
var Float64Array = require( '@stdlib/array/float64' );
120+
var zeroTo = require( '@stdlib/array/base/zero-to' );
121+
var fillBy = require( '@stdlib/array/base/fill-by' );
122+
123+
var x = new Float64Array( zeroTo( 6 ) );
124+
// returns <Float64Array>[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
125+
126+
var y = fillBy( x, 0, 6, constantFunction( 10.0 ) );
127+
// returns <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
128+
129+
y = fillBy( x, 0, 4, constantFunction( 0.0 ) );
130+
// returns <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 10.0, 10.0 ]
131+
132+
y = fillBy( x, 2, 6, constantFunction( 20.0 ) );
133+
// returns <Float64Array>[ 0.0, 0.0, 20.0, 20.0, 20.0, 20.0 ]
134+
135+
y = fillBy( x, 2, 4, constantFunction( 30.0 ) );
136+
// returns <Float64Array>[ 0.0, 0.0, 30.0, 30.0, 20.0, 20.0 ]
137+
```
138+
139+
</section>
140+
141+
<!-- /.examples -->
142+
143+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
144+
145+
<section class="references">
146+
147+
</section>
148+
149+
<!-- /.references -->
150+
151+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
152+
153+
<section class="related">
154+
155+
</section>
156+
157+
<!-- /.related -->
158+
159+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
160+
161+
<section class="links">
162+
163+
</section>
164+
165+
<!-- /.links -->

0 commit comments

Comments
 (0)