@gooddata/react-components
Version:
GoodData.UI - A powerful JavaScript library for building analytical applications
53 lines • 2.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// (C) 2007-2018 GoodData Corporation
var MappingHeader_1 = require("../interfaces/MappingHeader");
function hasMappingHeaderLocalIdentifier(header) {
return MappingHeader_1.isMappingHeaderAttribute(header) || MappingHeader_1.isMappingHeaderMeasureItem(header);
}
exports.hasMappingHeaderLocalIdentifier = hasMappingHeaderLocalIdentifier;
function getMappingHeaderLocalIdentifier(header) {
if (MappingHeader_1.isMappingHeaderAttribute(header)) {
return header.attributeHeader.localIdentifier;
}
if (MappingHeader_1.isMappingHeaderMeasureItem(header)) {
return header.measureHeaderItem.localIdentifier;
}
throw new Error("Mapping header of type \"" + Object.keys(header) + "\" has no localIdentifier");
}
exports.getMappingHeaderLocalIdentifier = getMappingHeaderLocalIdentifier;
function getMappingHeaderName(header) {
if (MappingHeader_1.isMappingHeaderAttribute(header)) {
return header.attributeHeader.formOf.name;
}
if (MappingHeader_1.isMappingHeaderAttributeItem(header)) {
return header.attributeHeaderItem.name;
}
if (MappingHeader_1.isMappingHeaderMeasureItem(header)) {
return header.measureHeaderItem.name;
}
}
exports.getMappingHeaderName = getMappingHeaderName;
function getMappingHeaderIdentifier(header) {
if (MappingHeader_1.isMappingHeaderAttribute(header)) {
return header.attributeHeader.identifier;
}
if (MappingHeader_1.isMappingHeaderMeasureItem(header)) {
return header.measureHeaderItem.identifier;
}
throw new Error("Mapping header of type \"" + Object.keys(header) + "\" has no identifier");
}
exports.getMappingHeaderIdentifier = getMappingHeaderIdentifier;
function getMappingHeaderUri(header) {
if (MappingHeader_1.isMappingHeaderAttribute(header)) {
return header.attributeHeader.uri;
}
if (MappingHeader_1.isMappingHeaderAttributeItem(header)) {
return header.attributeHeaderItem.uri;
}
if (MappingHeader_1.isMappingHeaderMeasureItem(header)) {
return header.measureHeaderItem.uri;
}
}
exports.getMappingHeaderUri = getMappingHeaderUri;
//# sourceMappingURL=mappingHeader.js.map