Skip to content

Update namespace TypeScript declarations #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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