Skip to content

Commit

Permalink
Replaced strict equality operators in places where the regular equali…
Browse files Browse the repository at this point in the history
…ty variant is just as safe.
  • Loading branch information
Pimm committed Nov 9, 2021
1 parent 2512af1 commit 901eeb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/index.js
Expand Up @@ -43,7 +43,7 @@ const { forEach } = [];
*/
export default function mapSort(list, mapCallback, compareFunction) {
// Ensure the map callback is a function. [1]
if ('function' !== typeof mapCallback) {
if ('function' != typeof mapCallback) {
// throw new TypeError(`${mapCallback} is not a function`);
// ↓ (We are compiling this code with Babel, and our current configuration compiles the above into something
// overly complex.)
Expand All @@ -69,7 +69,7 @@ export default function mapSort(list, mapCallback, compareFunction) {
// If the default compare function will be used, ensure the "sortable" value is not a symbol. That function does
// not accept symbol values. [4] (This would not work if Symbol is polyfilled. However, Symbol is widely supported
// and trying to sort a symbol is an edge case anyway. This shouldn't cause any real-world issues.)
if (undefined === compareFunction && 'symbol' === typeof sortable) {
if (undefined === compareFunction && 'symbol' == typeof sortable) {
throw new TypeError(`Can't convert symbol to string`);
}
// Push the index to the array of indexes.
Expand Down

0 comments on commit 901eeb6

Please sign in to comment.