UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

49 lines 1.67 kB
// SPDX-License-Identifier: Apache-2.0 import { TransformationType } from 'class-transformer'; import { UnsupportedOperationError } from '../../../../business/errors/unsupported-operation-error.js'; import { SemanticVersion } from '../../../../business/utils/semantic-version.js'; export class Transformations { constructor() { throw new UnsupportedOperationError('This class cannot be instantiated'); } static SemanticVersion = ({ value, type, }) => { switch (type) { case TransformationType.PLAIN_TO_CLASS: { return new SemanticVersion(value); } case TransformationType.CLASS_TO_PLAIN: { return value.toString(); } default: { return value; } } }; static DeploymentPhase = ({ value, type, }) => { switch (type) { case TransformationType.PLAIN_TO_CLASS: { return value?.trim().toLowerCase().replace('_', '-'); } case TransformationType.CLASS_TO_PLAIN: { return value.toString(); } default: { return value; } } }; static LedgerPhase = ({ value, type, }) => { switch (type) { case TransformationType.PLAIN_TO_CLASS: { return value?.trim().toLowerCase().replace('_', '-'); } case TransformationType.CLASS_TO_PLAIN: { return value.toString(); } default: { return value; } } }; } //# sourceMappingURL=transformations.js.map