Skip to content

Commit 7899d23

Browse files
authored
feat: update namespace TypeScript declarations
PR-URL: #6459 Reviewed-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 20e7abf commit 7899d23

File tree

2 files changed

+69
-10
lines changed

2 files changed

+69
-10
lines changed

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

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ import groupValues = require( '@stdlib/array/base/group-values' );
128128
import groupValuesBy = require( '@stdlib/array/base/group-values-by' );
129129
import incrspace = require( '@stdlib/array/base/incrspace' );
130130
import indexOf = require( '@stdlib/array/base/index-of' );
131+
import indexOfSameValue = require( '@stdlib/array/base/index-of-same-value' );
131132
import indicesComplement = require( '@stdlib/array/base/indices-complement' );
132133
import join = require( '@stdlib/array/base/join' );
133134
import last = require( '@stdlib/array/base/last' );
134135
import lastIndexOf = require( '@stdlib/array/base/last-index-of' );
136+
import lastIndexOfSameValue = require( '@stdlib/array/base/last-index-of-same-value' );
135137
import linspace = require( '@stdlib/array/base/linspace' );
136138
import logspace = require( '@stdlib/array/base/logspace' );
137139
import map2d = require( '@stdlib/array/base/map2d' );
@@ -2831,25 +2833,53 @@ interface Namespace {
28312833
* @param x - input array
28322834
* @param searchElement - search element
28332835
* @param fromIndex - starting index (inclusive)
2834-
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
28352836
* @returns index
28362837
*
28372838
* @example
28382839
* var x = [ 1, 2, 3, 4 ];
28392840
*
2840-
* var idx = ns.indexOf( x, 2, 0, false );
2841+
* var idx = ns.indexOf( x, 2, 0 );
28412842
* // returns 1
28422843
*
28432844
* @example
28442845
* var Int32Array = require( '@stdlib/array/int32' );
28452846
*
28462847
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
28472848
*
2848-
* var idx = ns.indexOf( x, 2, 0, false );
2849+
* var idx = ns.indexOf( x, 2, 0 );
28492850
* // returns 1
28502851
*/
28512852
indexOf: typeof indexOf;
28522853

2854+
/**
2855+
* Returns the index of the first element which equals a provided search element according to the same value algorithm.
2856+
*
2857+
* ## Notes
2858+
*
2859+
* - If unable to find an element which equals a provided search element, the function returns `-1`.
2860+
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
2861+
*
2862+
* @param x - input array
2863+
* @param searchElement - search element
2864+
* @param fromIndex - starting index (inclusive)
2865+
* @returns index
2866+
*
2867+
* @example
2868+
* var x = [ 1, 2, 3, 4 ];
2869+
*
2870+
* var idx = ns.indexOfSameValue( x, 2, 0 );
2871+
* // returns 1
2872+
*
2873+
* @example
2874+
* var Int32Array = require( '@stdlib/array/int32' );
2875+
*
2876+
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
2877+
*
2878+
* var idx = ns.indexOfSameValue( x, 2, 0 );
2879+
* // returns 1
2880+
*/
2881+
indexOfSameValue: typeof indexOfSameValue;
2882+
28532883
/**
28542884
* Returns the complement of a list of array indices.
28552885
*
@@ -2926,25 +2956,54 @@ interface Namespace {
29262956
* @param x - input array
29272957
* @param searchElement - search element
29282958
* @param fromIndex - starting index (inclusive)
2929-
* @param equalNaNs - boolean indicating whether NaNs should be considered equal
29302959
* @returns index
29312960
*
29322961
* @example
29332962
* var x = [ 1, 2, 3, 4 ];
29342963
*
2935-
* var idx = ns.lastIndexOf( x, 2, 3, false );
2964+
* var idx = ns.lastIndexOf( x, 2, 3 );
29362965
* // returns 1
29372966
*
29382967
* @example
29392968
* var Int32Array = require( '@stdlib/array/int32' );
29402969
*
29412970
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
29422971
*
2943-
* var idx = ns.lastIndexOf( x, 2, 3, false );
2972+
* var idx = ns.lastIndexOf( x, 2, 3 );
29442973
* // returns 1
29452974
*/
29462975
lastIndexOf: typeof lastIndexOf;
29472976

2977+
/**
2978+
* Returns the index of the last element which equals a provided search element according to the same value algorithm.
2979+
*
2980+
* ## Notes
2981+
*
2982+
* - The function scans an input array from the starting index to the beginning of the array (i.e., backward).
2983+
* - If unable to find an element which equals a provided search element, the function returns `-1`.
2984+
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last array element, with the last array element corresponding to `fromIndex = -1`.
2985+
*
2986+
* @param x - input array
2987+
* @param searchElement - search element
2988+
* @param fromIndex - starting index (inclusive)
2989+
* @returns index
2990+
*
2991+
* @example
2992+
* var x = [ 1, 2, 3, 4 ];
2993+
*
2994+
* var idx = ns.lastIndexOfSameValue( x, 2, 3 );
2995+
* // returns 1
2996+
*
2997+
* @example
2998+
* var Int32Array = require( '@stdlib/array/int32' );
2999+
*
3000+
* var x = new Int32Array( [ 1, 2, 3, 4 ] );
3001+
*
3002+
* var idx = ns.lastIndexOfSameValue( x, 2, 3 );
3003+
* // returns 1
3004+
*/
3005+
lastIndexOfSameValue: typeof lastIndexOfSameValue;
3006+
29483007
/**
29493008
* Generates a linearly spaced numeric array.
29503009
*

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ interface Namespace {
329329
*
330330
* ## Notes
331331
*
332-
* - When `val` is a string, the function checks whether the characters of the search string are found in the input string. The search is case-sensitive.
333-
* - When `val` is an array-like object, the function checks whether the input array contains an element strictly equal to the specified search value.
332+
* - When `value` is a string, the function checks whether the characters of the search string are found in the input string. The search is case-sensitive.
333+
* - When `value` is an array-like object, the function checks whether the input array contains an element which is the same as the specified search value.
334334
* - For strings, this function is modeled after `String.prototype.includes`, part of the ECMAScript 6 specification. This function is different from a call to `String.prototype.includes.call` insofar as type-checking is performed for all arguments.
335-
* - The function does not distinguish between positive and negative zero.
335+
* - The function does distinguish between positive and negative zero.
336336
* - If `position < 0`, the search is performed for the entire input array or string.
337337
*
338-
* @param val - input value
338+
* @param value - input value
339339
* @param searchValue - search value
340340
* @param position - position at which to start searching for `searchValue` (default: 0)
341341
* @throws second argument must be a primitive string primitive when the first argument is a string

0 commit comments

Comments
 (0)