"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToBazelDep = void 0;
const zod_1 = require("zod");
const bazel_1 = require("../../datasource/bazel");
const fragments_1 = require("./fragments");
const BazelDepSchema = fragments_1.RecordFragmentSchema.extend({
    children: zod_1.z.object({
        rule: fragments_1.StringFragmentSchema.extend({
            value: zod_1.z.literal('bazel_dep'),
        }),
        name: fragments_1.StringFragmentSchema,
        version: fragments_1.StringFragmentSchema,
        dev_dependency: fragments_1.BooleanFragmentSchema.optional(),
    }),
});
exports.ToBazelDep = BazelDepSchema.transform(({ children: { rule, name, version } }) => ({
    datasource: bazel_1.BazelDatasource.id,
    depType: rule.value,
    depName: name.value,
    currentValue: version.value,
}));
//# sourceMappingURL=bazel-dep.js.map