UNPKG

@controlplane/cli

Version:

Control Plane Corporation CLI

25 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ensureNumber = ensureNumber; exports.ensurePropertyPresence = ensurePropertyPresence; exports.raiseCustomK8sError = raiseCustomK8sError; exports.getFormattedWarning = getFormattedWarning; function ensureNumber(value) { if (typeof value === 'string') { return parseFloat(value); } return value; } function ensurePropertyPresence(property, filePath, object) { if (!object) { throw new Error(`ERROR: '${property}' is required for every object in the file '${filePath}'`); } throw new Error(`ERROR: '${property}' is required for object of kind '${object.kind}' and of metadata.name '${object.metadata.name}' in the file '${filePath}'`); } function raiseCustomK8sError(message, filePath, object) { throw new Error(`ERROR: ${message}. Object of kind ${object.kind} and of metadata.name '${object.metadata.name}' in the file '${filePath}'`); } function getFormattedWarning(message, filePath, object) { return `WARNING: ${message}. Object of kind ${object.kind} and of metadata.name '${object.metadata.name}' in the file '${filePath}'`; } //# sourceMappingURL=helper.js.map