@stdlib/array-base-count-same-value-zero 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -171,7 +171,7 @@ See [LICENSE][stdlib-license].
171
171
 
172
172
  ## Copyright
173
173
 
174
- Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
174
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
175
175
 
176
176
  </section>
177
177
 
@@ -184,8 +184,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
184
184
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-count-same-value-zero.svg
185
185
  [npm-url]: https://npmjs.org/package/@stdlib/array-base-count-same-value-zero
186
186
 
187
- [test-image]: https://github.com/stdlib-js/array-base-count-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.2.0
188
- [test-url]: https://github.com/stdlib-js/array-base-count-same-value-zero/actions/workflows/test.yml?query=branch:v0.2.0
187
+ [test-image]: https://github.com/stdlib-js/array-base-count-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.2.1
188
+ [test-url]: https://github.com/stdlib-js/array-base-count-same-value-zero/actions/workflows/test.yml?query=branch:v0.2.1
189
189
 
190
190
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-count-same-value-zero/main.svg
191
191
  [coverage-url]: https://codecov.io/github/stdlib-js/array-base-count-same-value-zero?branch=main
@@ -197,8 +197,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
197
197
 
198
198
  -->
199
199
 
200
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
201
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
200
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
201
+ [chat-url]: https://stdlib.zulipchat.com
202
202
 
203
203
  [stdlib]: https://github.com/stdlib-js/stdlib
204
204
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var f=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var s=f(function(k,v){
2
- var c=require('@stdlib/array-base-assert-is-complex-typed-array/dist'),q=require('@stdlib/array-base-assert-is-booleanarray/dist'),m=require('@stdlib/assert-is-complex-like/dist'),p=require('@stdlib/assert-is-boolean/dist').isPrimitive,g=require('@stdlib/complex-float64-real/dist'),l=require('@stdlib/complex-float64-imag/dist'),h=require('@stdlib/strided-base-reinterpret-complex/dist'),y=require('@stdlib/strided-base-reinterpret-boolean/dist'),A=require('@stdlib/array-base-assert-is-accessor-array/dist'),d=require('@stdlib/array-base-resolve-getter/dist'),u=require('@stdlib/assert-is-same-value-zero/dist');function B(e,r){var i,n;for(i=0,n=0;n<e.length;n++)u(e[n],r)&&(i+=1);return i}function w(e,r){var i,n,t;for(i=d(e),n=0,t=0;t<e.length;t++)u(i(e,t),r)&&(n+=1);return n}function C(e,r){var i,n,t,a,o;if(!m(r))return 0;for(n=g(r),t=l(r),i=h(e,0),a=0,o=0;o<i.length;o+=2)u(i[o],n)&&u(i[o+1],t)&&(a+=1);return a}function S(e,r){var i,n,t,a;if(!p(r))return 0;for(i=y(e,0),t=r?1:0,n=0,a=0;a<i.length;a++)i[a]===t&&(n+=1);return n}function V(e,r){return A(e,r)?c(e,r)?C(e,r):q(e,r)?S(e,r):w(e,r):B(e,r)}v.exports=V
1
+ "use strict";var f=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var s=f(function(k,v){
2
+ var c=require('@stdlib/array-base-assert-is-complex-typed-array/dist'),q=require('@stdlib/array-base-assert-is-booleanarray/dist'),l=require('@stdlib/assert-is-complex-like/dist'),m=require('@stdlib/assert-is-boolean/dist').isPrimitive,p=require('@stdlib/complex-float64-real/dist'),g=require('@stdlib/complex-float64-imag/dist'),h=require('@stdlib/strided-base-reinterpret-complex/dist'),y=require('@stdlib/strided-base-reinterpret-boolean/dist'),A=require('@stdlib/array-base-assert-is-accessor-array/dist'),d=require('@stdlib/array-base-resolve-getter/dist'),u=require('@stdlib/assert-is-same-value-zero/dist');function B(r,e){var i,n;for(i=0,n=0;n<r.length;n++)u(r[n],e)&&(i+=1);return i}function w(r,e){var i,n,a;for(i=d(r),n=0,a=0;a<r.length;a++)u(i(r,a),e)&&(n+=1);return n}function C(r,e){var i,n,a,t,o;if(!l(e))return 0;for(n=p(e),a=g(e),i=h(r,0),t=0,o=0;o<i.length;o+=2)u(i[o],n)&&u(i[o+1],a)&&(t+=1);return t}function S(r,e){var i,n,a,t;if(!m(e))return 0;for(i=y(r,0),a=e?1:0,n=0,t=0;t<i.length;t++)i[t]===a&&(n+=1);return n}function V(r,e){return A(r)?c(r)?C(r,e):q(r)?S(r,e):w(r,e):B(r,e)}v.exports=V
3
3
  });var Z=s();module.exports=Z;
4
4
  /** @license Apache-2.0 */
5
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/main.js", "../lib/index.js"],
4
- "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexTypedArray = require( '@stdlib/array-base-assert-is-complex-typed-array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar resolveGetter = require( '@stdlib/array-base-resolve-getter' );\nvar isSameValueZero = require( '@stdlib/assert-is-same-value-zero' );\n\n\n// FUNCTIONS //\n\n/**\n* Counts the number of elements in an indexed array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = indexed( x, 0 );\n* // returns 3\n*/\nfunction indexed( x, value ) {\n\tvar n;\n\tvar i;\n\n\tn = 0;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( isSameValueZero( x[ i ], value ) ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in an accessor array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n*\n* var x = toAccessorArray( [ 0, 0, 1, 0, 1 ] );\n*\n* var n = accessors( x, 0 );\n* // returns 3\n*/\nfunction accessors( x, value ) {\n\tvar get;\n\tvar n;\n\tvar i;\n\n\tget = resolveGetter( x );\n\n\tn = 0;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( isSameValueZero( get( x, i ), value ) ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in a complex array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var Complex128Array = require( '@stdlib/array-complex128' );\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var x = new Complex128Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] );\n*\n* var n = complex( x, new Complex128( 1.0, 2.0 ) );\n* // returns 1\n*/\nfunction complex( x, value ) {\n\tvar view;\n\tvar re;\n\tvar im;\n\tvar n;\n\tvar i;\n\n\tif ( !isComplexLike( value ) ) {\n\t\treturn 0;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\n\tview = reinterpret( x, 0 );\n\n\tn = 0;\n\tfor ( i = 0; i < view.length; i += 2 ) {\n\t\tif ( isSameValueZero( view[ i ], re ) && isSameValueZero( view[ i+1 ], im ) ) { // eslint-disable-line max-len\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in a boolean array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var BooleanArray = require( '@stdlib/array-bool' );\n*\n* var x = new BooleanArray( [ true, false, true, false, true ] );\n*\n* var n = boolean( x, true );\n* // returns 3\n*/\nfunction boolean( x, value ) {\n\tvar view;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tif ( !isBoolean( value ) ) {\n\t\treturn 0;\n\t}\n\tview = reinterpretBoolean( x, 0 );\n\n\tv = ( value ) ? 1 : 0;\n\tn = 0;\n\tfor ( i = 0; i < view.length; i++ ) {\n\t\tif ( view[ i ] === v ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an array that are equal to a specified value.\n*\n* ## Notes\n*\n* - The function uses the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to an implementation based on the strict equality operator `===`, the function treats `NaNs` as the same value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var countSameValueZero = require( '@stdlib/array-base-count-same-value-zero' );\n*\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = countSameValueZero( x, 1 );\n* // returns 2\n*/\nfunction countSameValueZero( x, value ) {\n\tif ( isAccessorArray( x, value ) ) {\n\t\tif ( isComplexTypedArray( x, value ) ) {\n\t\t\treturn complex( x, value );\n\t\t}\n\t\tif ( isBooleanArray( x, value ) ) {\n\t\t\treturn boolean( x, value );\n\t\t}\n\t\treturn accessors( x, value );\n\t}\n\treturn indexed( x, value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = countSameValueZero;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Count the number of elements in an array that are equal to a specified value.\n*\n* @module @stdlib/array-base-count-same-value-zero\n*\n* @example\n* var countSameValueZero = require( '@stdlib/array-base-count-same-value-zero' );\n*\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = countSameValueZero( x, 1 );\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAsB,QAAS,kDAAmD,EAClFC,EAAiB,QAAS,2CAA4C,EACtEC,EAAgB,QAA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V,EAAU,EAAI,EACpB,EAAI,EACEE,EAAI,EAAGA,EAAII,EAAK,OAAQJ,IACxBI,EAAMJ,CAAE,IAAMQ,IAClB,GAAK,GAGP,OAAO,CACR,CAyBA,SAASC,EAAoBZ,EAAGC,EAAQ,CACvC,OAAKL,EAAiBI,EAAGC,CAAM,EACzBb,EAAqBY,EAAGC,CAAM,EAC3BK,EAASN,EAAGC,CAAM,EAErBZ,EAAgBW,EAAGC,CAAM,EACtBS,EAASV,EAAGC,CAAM,EAEnBG,EAAWJ,EAAGC,CAAM,EAErBF,EAASC,EAAGC,CAAM,CAC1B,CAKAd,EAAO,QAAUyB,ICjLjB,IAAIC,EAAO,IAKX,OAAO,QAAUA",
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexTypedArray = require( '@stdlib/array-base-assert-is-complex-typed-array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar resolveGetter = require( '@stdlib/array-base-resolve-getter' );\nvar isSameValueZero = require( '@stdlib/assert-is-same-value-zero' );\n\n\n// FUNCTIONS //\n\n/**\n* Counts the number of elements in an indexed array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = indexed( x, 0 );\n* // returns 3\n*/\nfunction indexed( x, value ) {\n\tvar n;\n\tvar i;\n\n\tn = 0;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( isSameValueZero( x[ i ], value ) ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in an accessor array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n*\n* var x = toAccessorArray( [ 0, 0, 1, 0, 1 ] );\n*\n* var n = accessors( x, 0 );\n* // returns 3\n*/\nfunction accessors( x, value ) {\n\tvar get;\n\tvar n;\n\tvar i;\n\n\tget = resolveGetter( x );\n\n\tn = 0;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tif ( isSameValueZero( get( x, i ), value ) ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in a complex array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var Complex128Array = require( '@stdlib/array-complex128' );\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var x = new Complex128Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] );\n*\n* var n = complex( x, new Complex128( 1.0, 2.0 ) );\n* // returns 1\n*/\nfunction complex( x, value ) {\n\tvar view;\n\tvar re;\n\tvar im;\n\tvar n;\n\tvar i;\n\n\tif ( !isComplexLike( value ) ) {\n\t\treturn 0;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\n\tview = reinterpret( x, 0 );\n\n\tn = 0;\n\tfor ( i = 0; i < view.length; i += 2 ) {\n\t\tif ( isSameValueZero( view[ i ], re ) && isSameValueZero( view[ i+1 ], im ) ) { // eslint-disable-line max-len\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n/**\n* Counts the number of elements in a boolean array that are equal to a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var BooleanArray = require( '@stdlib/array-bool' );\n*\n* var x = new BooleanArray( [ true, false, true, false, true ] );\n*\n* var n = boolean( x, true );\n* // returns 3\n*/\nfunction boolean( x, value ) {\n\tvar view;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tif ( !isBoolean( value ) ) {\n\t\treturn 0;\n\t}\n\tview = reinterpretBoolean( x, 0 );\n\n\tv = ( value ) ? 1 : 0;\n\tn = 0;\n\tfor ( i = 0; i < view.length; i++ ) {\n\t\tif ( view[ i ] === v ) {\n\t\t\tn += 1;\n\t\t}\n\t}\n\treturn n;\n}\n\n\n// MAIN //\n\n/**\n* Counts the number of elements in an array that are equal to a specified value.\n*\n* ## Notes\n*\n* - The function uses the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to an implementation based on the strict equality operator `===`, the function treats `NaNs` as the same value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {NonNegativeInteger} number of elements that are equal to a specified value\n*\n* @example\n* var countSameValueZero = require( '@stdlib/array-base-count-same-value-zero' );\n*\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = countSameValueZero( x, 1 );\n* // returns 2\n*/\nfunction countSameValueZero( x, value ) {\n\tif ( isAccessorArray( x ) ) {\n\t\tif ( isComplexTypedArray( x ) ) {\n\t\t\treturn complex( x, value );\n\t\t}\n\t\tif ( isBooleanArray( x ) ) {\n\t\t\treturn boolean( x, value );\n\t\t}\n\t\treturn accessors( x, value );\n\t}\n\treturn indexed( x, value );\n}\n\n\n// EXPORTS //\n\nmodule.exports = countSameValueZero;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Count the number of elements in an array that are equal to a specified value.\n*\n* @module @stdlib/array-base-count-same-value-zero\n*\n* @example\n* var countSameValueZero = require( '@stdlib/array-base-count-same-value-zero' );\n*\n* var x = [ 0, 0, 1, 0, 1 ];\n*\n* var n = countSameValueZero( x, 1 );\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAsB,QAAS,kDAAmD,EAClFC,EAAiB,QAAS,2CAA4C,EACtEC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAY,QAAS,2BAA4B,EAAE,YACnDC,EAAO,QAAS,8BAA+B,EAC/CC,EAAO,QAAS,8BAA+B,EAC/CC,EAAc,QAAS,0CAA2C,EAClEC,EAAqB,QAAS,0CAA2C,EACzEC,EAAkB,QAAS,6CAA8C,EACzEC,EAAgB,QAAS,mCAAoC,EAC7DC,EAAkB,QAAS,mCAAoC,EAmBnE,SAASC,EAASC,EAAGC,EAAQ,CAC5B,IAAIC,EACAC,EAGJ,IADAD,EAAI,EACEC,EAAI,EAAGA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AM,CAC1B,CAKAd,EAAO,QAAUyB,ICjLjB,IAAIC,EAAO,IAKX,OAAO,QAAUA",
6
6
  "names": ["require_main", "__commonJSMin", "exports", "module", "isComplexTypedArray", "isBooleanArray", "isComplexLike", "isBoolean", "real", "imag", "reinterpret", "reinterpretBoolean", "isAccessorArray", "resolveGetter", "isSameValueZero", "indexed", "x", "value", "n", "i", "accessors", "get", "complex", "view", "re", "im", "boolean", "v", "countSameValueZero", "main"]
7
7
  }
package/lib/main.js CHANGED
@@ -196,11 +196,11 @@ function boolean( x, value ) {
196
196
  * // returns 2
197
197
  */
198
198
  function countSameValueZero( x, value ) {
199
- if ( isAccessorArray( x, value ) ) {
200
- if ( isComplexTypedArray( x, value ) ) {
199
+ if ( isAccessorArray( x ) ) {
200
+ if ( isComplexTypedArray( x ) ) {
201
201
  return complex( x, value );
202
202
  }
203
- if ( isBooleanArray( x, value ) ) {
203
+ if ( isBooleanArray( x ) ) {
204
204
  return boolean( x, value );
205
205
  }
206
206
  return accessors( x, value );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/array-base-count-same-value-zero",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Count the number of elements in an array that are equal to a specified value.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -33,7 +33,7 @@
33
33
  "@stdlib/array-base-assert-is-accessor-array": "^0.2.2",
34
34
  "@stdlib/array-base-assert-is-booleanarray": "^0.0.2",
35
35
  "@stdlib/array-base-assert-is-complex-typed-array": "^0.1.2",
36
- "@stdlib/array-base-resolve-getter": "^0.2.1",
36
+ "@stdlib/array-base-resolve-getter": "^0.2.2",
37
37
  "@stdlib/assert-is-boolean": "^0.2.2",
38
38
  "@stdlib/assert-is-complex-like": "^0.2.2",
39
39
  "@stdlib/assert-is-same-value-zero": "^0.2.2",