Skip to content

Commit e624c49

Browse files
authored
feat: update namespace TypeScript declarations
PR-URL: #1937 Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Reviewed-by: Planeshifter <1913638+Planeshifter@users.noreply.github.com>
1 parent 8c5698c commit e624c49

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

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

+43
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ import cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
6464
import copy = require( '@stdlib/array/base/copy' );
6565
import copyIndexed = require( '@stdlib/array/base/copy-indexed' );
6666
import countFalsy = require( '@stdlib/array/base/count-falsy' );
67+
import countSameValue = require( '@stdlib/array/base/count-same-value' );
68+
import countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' );
6769
import countTruthy = require( '@stdlib/array/base/count-truthy' );
6870
import dedupe = require( '@stdlib/array/base/dedupe' );
6971
import every = require( '@stdlib/array/base/every' );
@@ -1340,6 +1342,47 @@ interface Namespace {
13401342
*/
13411343
countFalsy: typeof countFalsy;
13421344

1345+
/**
1346+
* Counts the number of elements in an array that are equal to a specified value.
1347+
*
1348+
* ## Notes
1349+
*
1350+
* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.
1351+
* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.
1352+
*
1353+
* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12
1354+
*
1355+
* @param x - input array
1356+
* @param value - search value
1357+
* @returns number of elements that are equal to a specified value
1358+
*
1359+
* @example
1360+
* var x = [ 0, 1, 0, 1, 1 ];
1361+
*
1362+
* var out = ns.countSameValue( x, 1 );
1363+
* // returns 3
1364+
*/
1365+
countSameValue: typeof countSameValue;
1366+
1367+
/**
1368+
* Counts the number of elements in an array that are equal to a specified value.
1369+
*
1370+
* ## Notes
1371+
*
1372+
* - In contrast to an implementation based on the strict equality operator `===`, the function treats `NaNs` as the same value.
1373+
*
1374+
* @param x - input array
1375+
* @param value - search value
1376+
* @returns number of elements that are equal to a specified value
1377+
*
1378+
* @example
1379+
* var x = [ 0, 1, 0, 1, 1 ];
1380+
*
1381+
* var out = ns.countSameValueZero( x, 1 );
1382+
* // returns 3
1383+
*/
1384+
countSameValueZero: typeof countSameValueZero;
1385+
13431386
/**
13441387
* Counts the number of truthy values in an array.
13451388
*

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

+3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ import isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-p
206206
import isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' );
207207
import isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );
208208
import isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' );
209+
import isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' );
209210
import isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
210211
import isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
211212
import isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
@@ -4336,6 +4337,8 @@ interface Namespace {
43364337
*/
43374338
isNonEnumerablePropertyIn: typeof isNonEnumerablePropertyIn;
43384339

4340+
isNonNegativeFinite: typeof isNonNegativeFinite;
4341+
43394342
/**
43404343
* Tests if a value is a nonnegative integer.
43414344
*

0 commit comments

Comments
 (0)