2015-01-29 17:10:49 -08:00
|
|
|
/**
|
2015-03-23 15:07:33 -07:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-01-29 17:10:49 -08:00
|
|
|
*
|
2018-05-10 19:06:46 -07:00
|
|
|
* @format
|
2015-03-24 09:26:16 -07:00
|
|
|
* @flow
|
2015-01-29 17:10:49 -08:00
|
|
|
*/
|
2018-05-10 19:06:46 -07:00
|
|
|
|
2015-01-29 17:10:49 -08:00
|
|
|
'use strict';
|
|
|
|
|
2015-03-24 09:26:16 -07:00
|
|
|
type Point = {
|
2016-08-09 06:32:41 -07:00
|
|
|
x: ?number,
|
|
|
|
y: ?number,
|
2018-05-10 19:06:46 -07:00
|
|
|
};
|
2015-03-24 09:26:16 -07:00
|
|
|
|
2018-05-10 15:44:52 -07:00
|
|
|
const dummyPoint = {x: undefined, y: undefined};
|
2015-01-29 17:10:49 -08:00
|
|
|
|
2018-05-10 19:06:46 -07:00
|
|
|
const pointsDiffer = function(one: ?Point, two: ?Point): boolean {
|
2015-01-29 17:10:49 -08:00
|
|
|
one = one || dummyPoint;
|
|
|
|
two = two || dummyPoint;
|
2018-05-10 19:06:46 -07:00
|
|
|
return one !== two && (one.x !== two.x || one.y !== two.y);
|
2015-01-29 17:10:49 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = pointsDiffer;
|