@stdlib/assert-is-same-value-zero
Advanced tools
+1
-1
| "use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var t=s(function(m,u){ | ||
| var o=require('@stdlib/complex-base-assert-is-same-value-zero/dist'),i=require('@stdlib/assert-is-complex-like/dist');function n(r,e){return r===e||r!==r&&e!==e?!0:i(r)&&i(e)?o(r,e):!1}u.exports=n | ||
| var o=require('@stdlib/complex-float64-base-assert-is-same-value-zero/dist'),i=require('@stdlib/assert-is-complex-like/dist');function n(r,e){return r===e||r!==r&&e!==e?!0:i(r)&&i(e)?o(r,e):!1}u.exports=n | ||
| });var a=t();module.exports=a; | ||
| /** @license Apache-2.0 */ | ||
| //# sourceMappingURL=index.js.map |
| { | ||
| "version": 3, | ||
| "sources": ["../lib/main.js", "../lib/index.js"], | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isSameComplexValueZero = require( '@stdlib/complex-base-assert-is-same-value-zero' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\n\n\n// MAIN //\n\n/**\n* Tests if two arguments are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016, and includes support for complex number objects.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {*} a - first input value\n* @param {*} b - second input value\n* @returns {boolean} boolean indicating whether two arguments are the same value\n*\n* @example\n* var bool = isSameValueZero( true, true );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( {}, {} );\n* // returns false\n*\n* @example\n* var bool = isSameValueZero( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( -0.0, 0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( NaN, NaN );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( [], [] );\n* // returns false\n*/\nfunction isSameValueZero( a, b ) {\n\tif ( ( a === b ) || ( a !== a && b !== b ) ) { // handles NaNs\n\t\treturn true;\n\t}\n\tif ( isComplexLike( a ) && isComplexLike( b ) ) {\n\t\treturn isSameComplexValueZero( a, b );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValueZero;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Test if two arguments are the same value.\n*\n* @module @stdlib/assert-is-same-value-zero\n*\n* @example\n* var isSameValueZero = require( '@stdlib/assert-is-same-value-zero' );\n*\n* var bool = isSameValueZero( true, true );\n* // returns true\n*\n* bool = isSameValueZero( 3.14, 3.14 );\n* // returns true\n*\n* bool = isSameValueZero( {}, {} );\n* // returns false\n*\n* bool = isSameValueZero( -0.0, -0.0 );\n* // returns true\n*\n* bool = isSameValueZero( -0.0, 0.0 );\n* // returns true\n*\n* bool = isSameValueZero( NaN, NaN );\n* // returns true\n*\n* bool = isSameValueZero( [], [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAyB,QAAS,gDAAiD,EACnFC,EAAgB,QAAS,gCAAiC,EA6C9D,SAASC,EAAiBC,EAAGC,EAAI,CAChC,OAAOD,IAAMC,GAASD,IAAMA,GAAKC,IAAMA,EAC/B,GAEHH,EAAeE,CAAE,GAAKF,EAAeG,CAAE,EACpCJ,EAAwBG,EAAGC,CAAE,EAE9B,EACR,CAKAL,EAAO,QAAUG,IC7BjB,IAAIG,EAAO,IAKX,OAAO,QAAUA", | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 isSameComplexValueZero = require( '@stdlib/complex-float64-base-assert-is-same-value-zero' );\nvar isComplexLike = require( '@stdlib/assert-is-complex-like' );\n\n\n// MAIN //\n\n/**\n* Tests if two arguments are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016, and includes support for complex number objects.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {*} a - first input value\n* @param {*} b - second input value\n* @returns {boolean} boolean indicating whether two arguments are the same value\n*\n* @example\n* var bool = isSameValueZero( true, true );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( {}, {} );\n* // returns false\n*\n* @example\n* var bool = isSameValueZero( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( -0.0, 0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( NaN, NaN );\n* // returns true\n*\n* @example\n* var bool = isSameValueZero( [], [] );\n* // returns false\n*/\nfunction isSameValueZero( a, b ) {\n\tif ( ( a === b ) || ( a !== a && b !== b ) ) { // handles NaNs\n\t\treturn true;\n\t}\n\tif ( isComplexLike( a ) && isComplexLike( b ) ) {\n\t\treturn isSameComplexValueZero( a, b );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValueZero;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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* Test if two arguments are the same value.\n*\n* @module @stdlib/assert-is-same-value-zero\n*\n* @example\n* var isSameValueZero = require( '@stdlib/assert-is-same-value-zero' );\n*\n* var bool = isSameValueZero( true, true );\n* // returns true\n*\n* bool = isSameValueZero( 3.14, 3.14 );\n* // returns true\n*\n* bool = isSameValueZero( {}, {} );\n* // returns false\n*\n* bool = isSameValueZero( -0.0, -0.0 );\n* // returns true\n*\n* bool = isSameValueZero( -0.0, 0.0 );\n* // returns true\n*\n* bool = isSameValueZero( NaN, NaN );\n* // returns true\n*\n* bool = isSameValueZero( [], [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAyB,QAAS,wDAAyD,EAC3FC,EAAgB,QAAS,gCAAiC,EA6C9D,SAASC,EAAiBC,EAAGC,EAAI,CAChC,OAAOD,IAAMC,GAASD,IAAMA,GAAKC,IAAMA,EAC/B,GAEHH,EAAeE,CAAE,GAAKF,EAAeG,CAAE,EACpCJ,EAAwBG,EAAGC,CAAE,EAE9B,EACR,CAKAL,EAAO,QAAUG,IC7BjB,IAAIG,EAAO,IAKX,OAAO,QAAUA", | ||
| "names": ["require_main", "__commonJSMin", "exports", "module", "isSameComplexValueZero", "isComplexLike", "isSameValueZero", "a", "b", "main"] | ||
| } |
+1
-1
@@ -23,3 +23,3 @@ /** | ||
| var isSameComplexValueZero = require( '@stdlib/complex-base-assert-is-same-value-zero' ); | ||
| var isSameComplexValueZero = require( '@stdlib/complex-float64-base-assert-is-same-value-zero' ); | ||
| var isComplexLike = require( '@stdlib/assert-is-complex-like' ); | ||
@@ -26,0 +26,0 @@ |
+2
-2
| { | ||
| "name": "@stdlib/assert-is-same-value-zero", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "Test if two arguments are the same value.", | ||
@@ -34,3 +34,3 @@ "license": "Apache-2.0", | ||
| "@stdlib/assert-is-complex-like": "^0.2.1", | ||
| "@stdlib/complex-base-assert-is-same-value-zero": "^0.2.1" | ||
| "@stdlib/complex-float64-base-assert-is-same-value-zero": "^0.1.1" | ||
| }, | ||
@@ -37,0 +37,0 @@ "devDependencies": {}, |
+2
-2
@@ -209,4 +209,4 @@ <!-- | ||
| [test-image]: https://github.com/stdlib-js/assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.2.1 | ||
| [test-url]: https://github.com/stdlib-js/assert-is-same-value-zero/actions/workflows/test.yml?query=branch:v0.2.1 | ||
| [test-image]: https://github.com/stdlib-js/assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.2.2 | ||
| [test-url]: https://github.com/stdlib-js/assert-is-same-value-zero/actions/workflows/test.yml?query=branch:v0.2.2 | ||
@@ -213,0 +213,0 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/assert-is-same-value-zero/main.svg |
29545
0.11%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed