UNPKG

@salesforce/source-tracking

Version:

API for tracking local and remote Salesforce metadata changes

27 lines 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDefined = exports.isChangeResultWithNameAndType = exports.FileResponseHasPath = exports.FileResponseIsNotDeleted = exports.FileResponseIsDeleted = exports.isSdrSuccess = exports.isSdrFailure = exports.metadataMemberGuard = void 0; /* * 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 */ const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve"); const metadataMemberGuard = (input) => input !== undefined && typeof input.fullName === 'string' && typeof input.type === 'string'; exports.metadataMemberGuard = metadataMemberGuard; const isSdrFailure = (fileResponse) => fileResponse.state === source_deploy_retrieve_1.ComponentStatus.Failed; exports.isSdrFailure = isSdrFailure; const isSdrSuccess = (fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Failed; exports.isSdrSuccess = isSdrSuccess; const FileResponseIsDeleted = (fileResponse) => fileResponse.state === source_deploy_retrieve_1.ComponentStatus.Deleted; exports.FileResponseIsDeleted = FileResponseIsDeleted; const FileResponseIsNotDeleted = (fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Deleted; exports.FileResponseIsNotDeleted = FileResponseIsNotDeleted; const FileResponseHasPath = (fileResponse) => fileResponse.filePath !== undefined; exports.FileResponseHasPath = FileResponseHasPath; const isChangeResultWithNameAndType = (cr) => typeof cr === 'object' && typeof cr.name === 'string' && typeof cr.type === 'string'; exports.isChangeResultWithNameAndType = isChangeResultWithNameAndType; const isDefined = (x) => x !== undefined; exports.isDefined = isDefined; //# sourceMappingURL=guards.js.map