MCPcopy Create free account
hub / github.com/visgl/react-map-gl / arePointsEqual

Function arePointsEqual

modules/react-mapbox/src/utils/deep-equal.ts:9–15  ·  view source on GitHub ↗
(a?: PointLike, b?: PointLike)

Source from the content-addressed store, hash-verified

7 * @returns true if the points are equal
8 */
9export function arePointsEqual(a?: PointLike, b?: PointLike): boolean {
10 const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;
11 const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;
12 const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;
13 const by = Array.isArray(b) ? b[1] : b ? b.y : 0;
14 return ax === bx && ay === by;
15}
16
17/* eslint-disable complexity */
18/**

Callers 2

deep-equal.spec.jsFile · 0.90
marker.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…