2015-01-30 04:10:49 +03:00
|
|
|
/**
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-24 01:07:33 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03: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-30 04:10:49 +03:00
|
|
|
*
|
2018-05-11 05:06:46 +03:00
|
|
|
* @format
|
2015-03-24 19:26:16 +03:00
|
|
|
* @flow
|
2015-01-30 04:10:49 +03:00
|
|
|
*/
|
2018-05-11 05:06:46 +03:00
|
|
|
|
2015-01-30 04:10:49 +03:00
|
|
|
'use strict';
|
|
|
|
|
2015-03-24 19:26:16 +03:00
|
|
|
type Inset = {
|
2016-08-09 16:32:41 +03:00
|
|
|
top: ?number,
|
|
|
|
left: ?number,
|
|
|
|
right: ?number,
|
|
|
|
bottom: ?number,
|
2019-11-21 20:38:13 +03:00
|
|
|
...
|
2018-05-11 05:06:46 +03:00
|
|
|
};
|
2015-03-24 19:26:16 +03:00
|
|
|
|
2018-05-11 01:44:52 +03:00
|
|
|
const dummyInsets = {
|
2018-05-11 05:06:46 +03:00
|
|
|
top: undefined,
|
|
|
|
left: undefined,
|
|
|
|
right: undefined,
|
|
|
|
bottom: undefined,
|
2015-01-30 04:10:49 +03:00
|
|
|
};
|
|
|
|
|
2019-08-09 20:06:53 +03:00
|
|
|
const insetsDiffer = function(one: Inset, two: Inset): boolean {
|
2015-01-30 04:10:49 +03:00
|
|
|
one = one || dummyInsets;
|
|
|
|
two = two || dummyInsets;
|
2018-05-11 05:06:46 +03:00
|
|
|
return (
|
|
|
|
one !== two &&
|
|
|
|
(one.top !== two.top ||
|
|
|
|
one.left !== two.left ||
|
|
|
|
one.right !== two.right ||
|
|
|
|
one.bottom !== two.bottom)
|
2015-01-30 04:10:49 +03:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = insetsDiffer;
|