@stdlib/array-base-count-same-value 0.2.0 → 0.2.2
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 +1 -1
- package/README.md +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/lib/main.js +3 -3
- package/package.json +12 -12
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -166,7 +166,7 @@ See [LICENSE][stdlib-license].
|
|
|
166
166
|
|
|
167
167
|
## Copyright
|
|
168
168
|
|
|
169
|
-
Copyright © 2016-
|
|
169
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
170
170
|
|
|
171
171
|
</section>
|
|
172
172
|
|
|
@@ -179,8 +179,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
179
179
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/array-base-count-same-value.svg
|
|
180
180
|
[npm-url]: https://npmjs.org/package/@stdlib/array-base-count-same-value
|
|
181
181
|
|
|
182
|
-
[test-image]: https://github.com/stdlib-js/array-base-count-same-value/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
183
|
-
[test-url]: https://github.com/stdlib-js/array-base-count-same-value/actions/workflows/test.yml?query=branch:v0.2.
|
|
182
|
+
[test-image]: https://github.com/stdlib-js/array-base-count-same-value/actions/workflows/test.yml/badge.svg?branch=v0.2.2
|
|
183
|
+
[test-url]: https://github.com/stdlib-js/array-base-count-same-value/actions/workflows/test.yml?query=branch:v0.2.2
|
|
184
184
|
|
|
185
185
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-base-count-same-value/main.svg
|
|
186
186
|
[coverage-url]: https://codecov.io/github/stdlib-js/array-base-count-same-value?branch=main
|
|
@@ -192,8 +192,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
192
192
|
|
|
193
193
|
-->
|
|
194
194
|
|
|
195
|
-
[chat-image]: https://img.shields.io/
|
|
196
|
-
[chat-url]: https://
|
|
195
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
196
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
197
197
|
|
|
198
198
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
199
199
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var f=function(e
|
|
2
|
-
var c=require('@stdlib/assert-is-complex-like/dist'),q=require('@stdlib/assert-is-boolean/dist').isPrimitive,
|
|
1
|
+
"use strict";var f=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var s=f(function(G,v){
|
|
2
|
+
var c=require('@stdlib/assert-is-complex-like/dist'),q=require('@stdlib/assert-is-boolean/dist').isPrimitive,l=require('@stdlib/strided-base-reinterpret-complex/dist'),m=require('@stdlib/strided-base-reinterpret-boolean/dist'),p=require('@stdlib/array-base-assert-is-complex-typed-array/dist'),g=require('@stdlib/array-base-assert-is-booleanarray/dist'),h=require('@stdlib/array-base-assert-is-accessor-array/dist'),y=require('@stdlib/array-base-resolve-getter/dist'),u=require('@stdlib/assert-is-same-value/dist'),A=require('@stdlib/complex-float64-real/dist'),d=require('@stdlib/complex-float64-imag/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=y(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(!c(e))return 0;for(n=A(e),a=d(e),i=l(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(!q(e))return 0;for(i=m(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 h(r)?p(r)?C(r,e):g(r)?S(r,e):w(r,e):B(r,e)}v.exports=V
|
|
3
3
|
});var b=s();module.exports=b;
|
|
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 isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar isComplexTypedArray = require( '@stdlib/array-base-assert-is-complex-typed-array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar resolveGetter = require( '@stdlib/array-base-resolve-getter' );\nvar isSameValue = require( '@stdlib/assert-is-same-value' );\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\n\n\n// FUNCTIONS //\n\n/**\n* Counts the number of elements in an 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, 1, 0, 1, 1 ];\n*\n* var n = indexed( x, 1 );\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 ( isSameValue( 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 provided value\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n*\n* var x = toAccessorArray( [ 0, 1, 0, 1, 1 ] );\n*\n* var n = accessors( x, 1 );\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 ( isSameValue( 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 ( isSameValue( view[ i ], re ) && isSameValue( view[ i+1 ], im ) ) {\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 [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\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 x = [ 0, 1, 0, 1, 1 ];\n*\n* var n = countSameValue( x, 1 );\n* // returns 3\n*/\nfunction countSameValue( x, value ) {\n\tif ( isAccessorArray( x
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAY,QAAS,2BAA4B,EAAE,YACnDC,EAAc,QAAS,0CAA2C,EAClEC,EAAqB,QAAS,0CAA2C,EACzEC,EAAsB,QAAS,kDAAmD,EAClFC,EAAiB,QAAS,2CAA4C,EACtEC,EAAkB,QAAS,6CAA8C,EACzEC,EAAgB,QAAS,mCAAoC,EAC7DC,EAAc,QAAS,8BAA+B,EACtDC,EAAO,QAAS,8BAA+B,EAC/CC,EAAO,QAAS,8BAA+B,EAmBnD,SAASC,EAASC,EAAGC,EAAQ,CAC5B,IAAIC,EACAC,EAGJ,IADAD,EAAI,EACEC,EAAI,EAAGA,EAAIH,EAAE,OAAQG,IACrBP,EAAaI,EAAGG,CAAE,EAAGF,CAAM,IAC/BC,GAAK,GAGP,OAAOA,CACR,CAkBA,SAASE,EAAWJ,EAAGC,EAAQ,CAC9B,IAAII,EACA,EACAF,EAKJ,IAHAE,EAAMV,EAAeK,CAAE,EAEvB,EAAI,EACEG,EAAI,EAAGA,EAAIH,EAAE,OAAQG,IACrBP,EAAaS,EAAKL,EAAGG,CAAE,EAAGF,CAAM,IACpC,GAAK,GAGP,OAAO,CACR,CAmBA,SAASK,EAASN,EAAGC,EAAQ,CAC5B,IAAIM,EACAC,EACAC,EACAP,EACAC,EAEJ,GAAK,CAACf,EAAea,CAAM,EAC1B,MAAO,GAQR,IANAO,EAAKX,EAAMI,CAAM,EACjBQ,EAAKX,EAAMG,CAAM,EAEjBM,EAAOjB,EAAaU,EAAG,CAAE,EAEzBE,EAAI,EACEC,EAAI,EAAGA,EAAII,EAAK,OAAQJ,GAAK,EAC7BP,EAAaW,EAAMJ,CAAE,EAAGK,CAAG,GAAKZ,EAAaW,EAAMJ,EAAE,CAAE,EAAGM,CAAG,IACjEP,GAAK,GAGP,OAAOA,CACR,CAkBA,SAASQ,EAASV,EAAGC,EAAQ,CAC5B,IAAIM,EACA,EACAI,EACAR,EAEJ,GAAK,CAACd,EAAWY,CAAM,EACtB,MAAO,GAMR,IAJAM,EAAOhB,EAAoBS,EAAG,CAAE,EAEhCW,EAAMV,EAAU,EAAI,EACpB,EAAI,EACEE,EAAI,EAAGA,EAAII,EAAK,OAAQJ,IACxBI,EAAMJ,CAAE,IAAMQ,IAClB,GAAK,GAGP,OAAO,CACR,CAyBA,SAASC,EAAgBZ,EAAGC,EAAQ,CACnC,OAAKP,EAAiBM,
|
|
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 isComplexLike = require( '@stdlib/assert-is-complex-like' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar reinterpret = require( '@stdlib/strided-base-reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar isComplexTypedArray = require( '@stdlib/array-base-assert-is-complex-typed-array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar resolveGetter = require( '@stdlib/array-base-resolve-getter' );\nvar isSameValue = require( '@stdlib/assert-is-same-value' );\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\n\n\n// FUNCTIONS //\n\n/**\n* Counts the number of elements in an 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, 1, 0, 1, 1 ];\n*\n* var n = indexed( x, 1 );\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 ( isSameValue( 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 provided value\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n*\n* var x = toAccessorArray( [ 0, 1, 0, 1, 1 ] );\n*\n* var n = accessors( x, 1 );\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 ( isSameValue( 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 ( isSameValue( view[ i ], re ) && isSameValue( view[ i+1 ], im ) ) {\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 [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\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 x = [ 0, 1, 0, 1, 1 ];\n*\n* var n = countSameValue( x, 1 );\n* // returns 3\n*/\nfunction countSameValue( 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 = countSameValue;\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\n*\n* @example\n* var countSameValue = require( '@stdlib/array-base-count-same-value' );\n*\n* var x = [ 0, 1, 0, 1, 1 ];\n*\n* var n = countSameValue( x, 1 );\n* // returns 3\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,EAAgB,QAAS,gCAAiC,EAC1DC,EAAY,QAAS,2BAA4B,EAAE,YACnDC,EAAc,QAAS,0CAA2C,EAClEC,EAAqB,QAAS,0CAA2C,EACzEC,EAAsB,QAAS,kDAAmD,EAClFC,EAAiB,QAAS,2CAA4C,EACtEC,EAAkB,QAAS,6CAA8C,EACzEC,EAAgB,QAAS,mCAAoC,EAC7DC,EAAc,QAAS,8BAA+B,EACtDC,EAAO,QAAS,8BAA+B,EAC/CC,EAAO,QAAS,8BAA+B,EAmBnD,SAASC,EAASC,EAAGC,EAAQ,CAC5B,IAAIC,EACAC,EAGJ,IADAD,EAAI,EACEC,EAAI,EAAGA,EAAIH,EAAE,OAAQG,IACrBP,EAAaI,EAAGG,CAAE,EAAGF,CAAM,IAC/BC,GAAK,GAGP,OAAOA,CACR,CAkBA,SAASE,EAAWJ,EAAGC,EAAQ,CAC9B,IAAII,EACA,EACAF,EAKJ,IAHAE,EAAMV,EAAeK,CAAE,EAEvB,EAAI,EACEG,EAAI,EAAGA,EAAIH,EAAE,OAAQG,IACrBP,EAAaS,EAAKL,EAAGG,CAAE,EAAGF,CAAM,IACpC,GAAK,GAGP,OAAO,CACR,CAmBA,SAASK,EAASN,EAAGC,EAAQ,CAC5B,IAAIM,EACAC,EACAC,EACAP,EACAC,EAEJ,GAAK,CAACf,EAAea,CAAM,EAC1B,MAAO,GAQR,IANAO,EAAKX,EAAMI,CAAM,EACjBQ,EAAKX,EAAMG,CAAM,EAEjBM,EAAOjB,EAAaU,EAAG,CAAE,EAEzBE,EAAI,EACEC,EAAI,EAAGA,EAAII,EAAK,OAAQJ,GAAK,EAC7BP,EAAaW,EAAMJ,CAAE,EAAGK,CAAG,GAAKZ,EAAaW,EAAMJ,EAAE,CAAE,EAAGM,CAAG,IACjEP,GAAK,GAGP,OAAOA,CACR,CAkBA,SAASQ,EAASV,EAAGC,EAAQ,CAC5B,IAAIM,EACA,EACAI,EACAR,EAEJ,GAAK,CAACd,EAAWY,CAAM,EACtB,MAAO,GAMR,IAJAM,EAAOhB,EAAoBS,EAAG,CAAE,EAEhCW,EAAMV,EAAU,EAAI,EACpB,EAAI,EACEE,EAAI,EAAGA,EAAII,EAAK,OAAQJ,IACxBI,EAAMJ,CAAE,IAAMQ,IAClB,GAAK,GAGP,OAAO,CACR,CAyBA,SAASC,EAAgBZ,EAAGC,EAAQ,CACnC,OAAKP,EAAiBM,CAAE,EAClBR,EAAqBQ,CAAE,EACpBM,EAASN,EAAGC,CAAM,EAErBR,EAAgBO,CAAE,EACfU,EAASV,EAAGC,CAAM,EAEnBG,EAAWJ,EAAGC,CAAM,EAErBF,EAASC,EAAGC,CAAM,CAC1B,CAKAd,EAAO,QAAUyB,ICjLjB,IAAIC,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "isComplexLike", "isBoolean", "reinterpret", "reinterpretBoolean", "isComplexTypedArray", "isBooleanArray", "isAccessorArray", "resolveGetter", "isSameValue", "real", "imag", "indexed", "x", "value", "n", "i", "accessors", "get", "complex", "view", "re", "im", "boolean", "v", "countSameValue", "main"]
|
|
7
7
|
}
|
package/lib/main.js
CHANGED
|
@@ -196,11 +196,11 @@ function boolean( x, value ) {
|
|
|
196
196
|
* // returns 3
|
|
197
197
|
*/
|
|
198
198
|
function countSameValue( x, value ) {
|
|
199
|
-
if ( isAccessorArray( x
|
|
200
|
-
if ( isComplexTypedArray( x
|
|
199
|
+
if ( isAccessorArray( x ) ) {
|
|
200
|
+
if ( isComplexTypedArray( x ) ) {
|
|
201
201
|
return complex( x, value );
|
|
202
202
|
}
|
|
203
|
-
if ( isBooleanArray( x
|
|
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",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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": {
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/array-base-assert-is-accessor-array": "^0.2.
|
|
34
|
-
"@stdlib/array-base-assert-is-booleanarray": "^0.0.
|
|
35
|
-
"@stdlib/array-base-assert-is-complex-typed-array": "^0.1.
|
|
36
|
-
"@stdlib/array-base-resolve-getter": "^0.2.
|
|
37
|
-
"@stdlib/assert-is-boolean": "^0.2.
|
|
38
|
-
"@stdlib/assert-is-complex-like": "^0.2.
|
|
39
|
-
"@stdlib/assert-is-same-value": "^0.2.
|
|
40
|
-
"@stdlib/complex-float64-imag": "^0.1.
|
|
41
|
-
"@stdlib/complex-float64-real": "^0.1.
|
|
42
|
-
"@stdlib/strided-base-reinterpret-boolean": "^0.0.
|
|
43
|
-
"@stdlib/strided-base-reinterpret-complex": "^0.1.
|
|
33
|
+
"@stdlib/array-base-assert-is-accessor-array": "^0.2.3",
|
|
34
|
+
"@stdlib/array-base-assert-is-booleanarray": "^0.0.3",
|
|
35
|
+
"@stdlib/array-base-assert-is-complex-typed-array": "^0.1.3",
|
|
36
|
+
"@stdlib/array-base-resolve-getter": "^0.2.2",
|
|
37
|
+
"@stdlib/assert-is-boolean": "^0.2.3",
|
|
38
|
+
"@stdlib/assert-is-complex-like": "^0.2.4",
|
|
39
|
+
"@stdlib/assert-is-same-value": "^0.2.3",
|
|
40
|
+
"@stdlib/complex-float64-imag": "^0.1.2",
|
|
41
|
+
"@stdlib/complex-float64-real": "^0.1.2",
|
|
42
|
+
"@stdlib/strided-base-reinterpret-boolean": "^0.0.3",
|
|
43
|
+
"@stdlib/strided-base-reinterpret-complex": "^0.1.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {},
|
|
46
46
|
"engines": {
|