Skip to content

Commit b2a63e4

Browse files
committed
Auto-generated commit
1 parent 0e434ed commit b2a63e4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ The namespace exports the following:
235235
- <span class="signature">[`unary5d( arrays, shape, fcn )`][@stdlib/array/base/unary5d]</span><span class="delimiter">: </span><span class="description">apply a unary callback to elements in a five-dimensional nested input array and assign results to elements in a five-dimensional nested output array.</span>
236236
- <span class="signature">[`unarynd( arrays, shape, fcn )`][@stdlib/array/base/unarynd]</span><span class="delimiter">: </span><span class="description">apply a unary callback to elements in an n-dimensional nested input array and assign results to elements in an n-dimensional nested output array.</span>
237237
- <span class="signature">[`unitspace( start, stop )`][@stdlib/array/base/unitspace]</span><span class="delimiter">: </span><span class="description">generate a linearly spaced numeric array whose elements increment by 1.</span>
238+
- <span class="signature">[`arrayWith( x, index, value )`][@stdlib/array/base/with]</span><span class="delimiter">: </span><span class="description">return a new array with the element at the specified index replaced with a provided value.</span>
238239
- <span class="signature">[`zeroTo( n )`][@stdlib/array/base/zero-to]</span><span class="delimiter">: </span><span class="description">generate a linearly spaced numeric array whose elements increment by 1 starting from zero.</span>
239240
- <span class="signature">[`zeros( len )`][@stdlib/array/base/zeros]</span><span class="delimiter">: </span><span class="description">create a zero-filled "generic" array.</span>
240241
- <span class="signature">[`zeros2d( shape )`][@stdlib/array/base/zeros2d]</span><span class="delimiter">: </span><span class="description">create a zero-filled two-dimensional nested array.</span>
@@ -666,6 +667,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
666667

667668
[@stdlib/array/base/unitspace]: https://github.com/stdlib-js/array-base-unitspace
668669

670+
[@stdlib/array/base/with]: https://github.com/stdlib-js/array-base-with
671+
669672
[@stdlib/array/base/zero-to]: https://github.com/stdlib-js/array-base-zero-to
670673

671674
[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros

docs/types/index.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ import unary4d = require( '@stdlib/array-base-unary4d' );
177177
import unary5d = require( '@stdlib/array-base-unary5d' );
178178
import unarynd = require( '@stdlib/array-base-unarynd' );
179179
import unitspace = require( '@stdlib/array-base-unitspace' );
180+
import arrayWith = require( '@stdlib/array-base-with' );
180181
import zeroTo = require( '@stdlib/array-base-zero-to' );
181182
import zeros = require( '@stdlib/array-base-zeros' );
182183
import zeros2d = require( '@stdlib/array-base-zeros2d' );
@@ -3996,6 +3997,28 @@ interface Namespace {
39963997
*/
39973998
unitspace: typeof unitspace;
39983999

4000+
/**
4001+
* Returns a new array with the element at the specified index replaced with a provided value.
4002+
*
4003+
* @param x - input array
4004+
* @param index - index at which to set a provided value
4005+
* @param value - replacement value
4006+
* @returns output array
4007+
*
4008+
* @example
4009+
* var x = [ 1, 2, 3 ];
4010+
*
4011+
* var out = ns.arrayWith( x, 0, 7 );
4012+
* // returns [ 7, 2, 3 ]
4013+
*
4014+
* @example
4015+
* var x = [ 1, 2, 3, 4, 5, 6 ];
4016+
*
4017+
* var out = ns.arrayWith( x, 2, 8 );
4018+
* // returns [ 1, 8, 3, 4, 5, 6 ]
4019+
*/
4020+
arrayWith: typeof arrayWith;
4021+
39994022
/**
40004023
* Generates a linearly spaced numeric array whose elements increment by 1 starting from zero.
40014024
*

0 commit comments

Comments
 (0)