From 589508b807f451ac546ff0076cafe056ad2bddfd Mon Sep 17 00:00:00 2001 From: Amir Hoseinian Date: Wed, 6 Dec 2017 10:14:33 +0100 Subject: [PATCH] Fix PR problems --- src/shallowEqual.js | 15 ++++++--------- src/translate.js | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/shallowEqual.js b/src/shallowEqual.js index 4e6325139..591ee0bd4 100644 --- a/src/shallowEqual.js +++ b/src/shallowEqual.js @@ -9,9 +9,7 @@ * @flow */ -/*eslint-disable no-self-compare */ - -"use strict"; +/* eslint-disable no-self-compare */ const hasOwnProperty = Object.prototype.hasOwnProperty; @@ -26,10 +24,9 @@ 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; } /** @@ -37,15 +34,15 @@ function is(x, y) { * 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; diff --git a/src/translate.js b/src/translate.js index 17ce4f607..22903c217 100644 --- a/src/translate.js +++ b/src/translate.js @@ -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';