Skip to content

Commit

Permalink
feat: update namespace TypeScript declarations
Browse files Browse the repository at this point in the history
Signed-off-by: stdlib-bot <[email protected]>
  • Loading branch information
Planeshifter authored and stdlib-bot committed Mar 17, 2024
1 parent 8c5698c commit deeb2ef
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lib/node_modules/@stdlib/array/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
import copy = require( '@stdlib/array/base/copy' );
import copyIndexed = require( '@stdlib/array/base/copy-indexed' );
import countFalsy = require( '@stdlib/array/base/count-falsy' );
import countSameValue = require( '@stdlib/array/base/count-same-value' );
import countSameValueZero = require( '@stdlib/array/base/count-same-value-zero' );
import countTruthy = require( '@stdlib/array/base/count-truthy' );
import dedupe = require( '@stdlib/array/base/dedupe' );
import every = require( '@stdlib/array/base/every' );
Expand Down Expand Up @@ -1340,6 +1342,47 @@ interface Namespace {
*/
countFalsy: typeof countFalsy;

/**
* Counts the number of elements in an array that are equal to a specified value.
*
* ## Notes
*
* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.
* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.
*
* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12
*
* @param x - input array
* @param value - search value
* @returns number of elements that are equal to a specified value
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countSameValue( x, 1 );
* // returns 3
*/
countSameValue: typeof countSameValue;

/**
* Counts the number of elements in an array that are equal to a specified value.
*
* ## Notes
*
* - In contrast to an implementation based on the strict equality operator `===`, the function treats `NaNs` as the same value.
*
* @param x - input array
* @param value - search value
* @returns number of elements that are equal to a specified value
*
* @example
* var x = [ 0, 1, 0, 1, 1 ];
*
* var out = ns.countSameValueZero( x, 1 );
* // returns 3
*/
countSameValueZero: typeof countSameValueZero;

/**
* Counts the number of truthy values in an array.
*
Expand Down
3 changes: 3 additions & 0 deletions lib/node_modules/@stdlib/assert/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ import isNonConfigurableProperty = require( '@stdlib/assert/is-nonconfigurable-p
import isNonConfigurablePropertyIn = require( '@stdlib/assert/is-nonconfigurable-property-in' );
import isNonEnumerableProperty = require( '@stdlib/assert/is-nonenumerable-property' );
import isNonEnumerablePropertyIn = require( '@stdlib/assert/is-nonenumerable-property-in' );
import isNonNegativeFinite = require( '@stdlib/assert/is-nonnegative-finite' );
import isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
import isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
import isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
Expand Down Expand Up @@ -4336,6 +4337,8 @@ interface Namespace {
*/
isNonEnumerablePropertyIn: typeof isNonEnumerablePropertyIn;

isNonNegativeFinite: typeof isNonNegativeFinite;

/**
* Tests if a value is a nonnegative integer.
*
Expand Down

0 comments on commit deeb2ef

Please sign in to comment.