@releaseotto/core
Version:
OTTO performs your action on new versioning of APIs, packages, schemas, etc. Keepings things nice and neatly automated.
31 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createOttoConfig = void 0;
const Automate_1 = require("types/automator/Automate");
const DependenciesType_1 = require("types/automator/DependenciesType");
const GithubLocationConfig_1 = require("types/automator/GithubLocationConfig");
const GithubRepositoryPackage_1 = require("types/automator/GithubRepositoryPackage");
const LocationType_1 = require("types/automator/LocationType");
function createOttoConfig(obj) {
var _a;
const otto = Automate_1.Automate.unmarshal(obj);
switch ((_a = otto.location) === null || _a === void 0 ? void 0 : _a.type) {
case LocationType_1.LocationType.GITHUB:
otto.location.config = GithubLocationConfig_1.GithubLocationConfig.unmarshal(JSON.stringify(otto.location.config));
break;
default:
break;
}
for (const dependency of otto.dependencies || []) {
switch (dependency.type) {
case DependenciesType_1.DependenciesType.GITHUB_MINUS_REPOSITORY_MINUS_PACKAGE:
dependency.config = GithubRepositoryPackage_1.GithubRepositoryPackage.unmarshal(JSON.stringify(dependency.config));
break;
default:
break;
}
}
return otto;
}
exports.createOttoConfig = createOttoConfig;
//# sourceMappingURL=Otto.js.map