summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/utils/pause/mapScopes/mappingContains.js
blob: ca82fe42eccc157c80a15a9856105c33d9cc36da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

import { positionCmp } from "./positionCmp";

export function mappingContains(mapped, item) {
  return (
    positionCmp(item.start, mapped.start) >= 0 &&
    positionCmp(item.end, mapped.end) <= 0
  );
}