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