UNPKG

salesforce-alm

Version:

This package contains tools, and APIs, for an improved salesforce.com developer experience.

35 lines (33 loc) 1.54 kB
"use strict"; /* * Copyright (c) 2020, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DataMappingObjectDefinitionMetadataType = void 0; const path = require("path"); const defaultMetadataType_1 = require("./defaultMetadataType"); const PathUtil = require("../sourcePathUtil"); class DataMappingObjectDefinitionMetadataType extends defaultMetadataType_1.DefaultMetadataType { hasIndividuallyAddressableChildWorkspaceElements() { return true; } getAggregateMetadataFilePathFromWorkspacePath(filePath) { return PathUtil.removeParentDirFromPath(filePath); } entityExistsInWorkspace(metadataFilePath) { const aggregateFullName = this.getAggregateFullNameFromFilePath(metadataFilePath); return PathUtil.canRead(path.join(path.dirname(metadataFilePath), aggregateFullName)); } isContainerValid(container) { const containerDataNodes = container.data.childNodes; return !(containerDataNodes && containerDataNodes[0].tagName == 'xml' && containerDataNodes[1].tagName == this.getMetadataName() && containerDataNodes[1].childNodes.length == 0); } } exports.DataMappingObjectDefinitionMetadataType = DataMappingObjectDefinitionMetadataType; //# sourceMappingURL=dataMappingObjectDefinitionMetadataType.js.map