"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWorkerValidationIssue = createWorkerValidationIssue;
exports.addWorkerValidationIssue = addWorkerValidationIssue;
exports.createWorkerSemanticValidationIssue = createWorkerSemanticValidationIssue;
exports.addWorkerSemanticValidationIssue = addWorkerSemanticValidationIssue;
exports.appendWorkerValidationIssues = appendWorkerValidationIssues;
exports.addWorkerZodValidationIssue = addWorkerZodValidationIssue;
exports.prefixWorkerValidationIssuePath = prefixWorkerValidationIssuePath;
const zod_1 = require("zod");
function createWorkerValidationIssue(issue) {
    return issue;
}
function addWorkerValidationIssue(issues, issue) {
    issues.push(createWorkerValidationIssue(issue));
}
function createWorkerSemanticValidationIssue(issue) {
    return createWorkerValidationIssue({
        ...issue,
        code: "semantic_invalid",
    });
}
function addWorkerSemanticValidationIssue(issues, issue) {
    issues.push(createWorkerSemanticValidationIssue(issue));
}
function appendWorkerValidationIssues(issues, newIssues) {
    issues.push(...newIssues);
}
function addWorkerZodValidationIssue(context, issue) {
    context.addIssue({
        code: zod_1.z.ZodIssueCode.custom,
        path: issue.path,
        message: issue.message,
    });
}
function prefixWorkerValidationIssuePath(prefix, issue) {
    return {
        ...issue,
        path: [...prefix, ...issue.path],
    };
}
