covutils
Version:
Utilities for creating, transforming, and handling Coverage Data objects.
31 lines (25 loc) • 608 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isCoverage = isCoverage;
exports.checkCoverage = checkCoverage;
exports.isDomain = isDomain;
exports.checkDomain = checkDomain;
var _constants = require('./constants.js');
function isCoverage(obj) {
return obj.type === _constants.COVERAGE;
}
function checkCoverage(obj) {
if (!isCoverage(obj)) {
throw new Error('must be a Coverage');
}
}
function isDomain(obj) {
return obj.type === _constants.DOMAIN;
}
function checkDomain(obj) {
if (!isDomain(obj)) {
throw new Error('must be a Domain');
}
}