From deeb2ef3cc14196589ffc102c83e0894d7e65982 Mon Sep 17 00:00:00 2001 From: Planeshifter <1913638+Planeshifter@users.noreply.github.com> Date: Sun, 17 Mar 2024 14:21:30 +0000 Subject: [PATCH] feat: update namespace TypeScript declarations Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../@stdlib/array/base/docs/types/index.d.ts | 43 +++++++++++++++++++ .../@stdlib/assert/docs/types/index.d.ts | 3 ++ 2 files changed, 46 insertions(+) diff --git a/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts index b5ad9be9f8a0..fc6058e1fcac 100644 --- a/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/base/docs/types/index.d.ts @@ -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' ); @@ -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. * diff --git a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts index 58f61e58a7b5..dbc1fc4f0926 100644 --- a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts @@ -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' ); @@ -4336,6 +4337,8 @@ interface Namespace { */ isNonEnumerablePropertyIn: typeof isNonEnumerablePropertyIn; + isNonNegativeFinite: typeof isNonNegativeFinite; + /** * Tests if a value is a nonnegative integer. *