Skip to content

Commit

Permalink
Fix PR problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Hoseinian committed Dec 6, 2017
1 parent 1cec3d1 commit 589508b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions src/shallowEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
* @flow
*/

/*eslint-disable no-self-compare */

"use strict";
/* eslint-disable no-self-compare */

const hasOwnProperty = Object.prototype.hasOwnProperty;

Expand All @@ -26,26 +24,25 @@ function is(x, y) {
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}

/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
export function shallowEqual(objA, objB) {
export default function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}

if (
typeof objA !== "object" ||
typeof objA !== 'object' ||
objA === null ||
typeof objB !== "object" ||
typeof objB !== 'object' ||
objB === null
) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import hoistStatics from 'hoist-non-react-statics';
import { shallowEqual } from './shallowEqual';
import shallowEqual from './shallowEqual';
import { getDefaults, setDefaults, getI18n, setI18n } from './context';
import I18n from './I18n';

Expand Down

0 comments on commit 589508b

Please sign in to comment.