"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isErrnoCode = isErrnoCode;
exports.isAnyErrnoCode = isAnyErrnoCode;
exports.isMissingFileError = isMissingFileError;
exports.isAlreadyExistsError = isAlreadyExistsError;
exports.isZodParseError = isZodParseError;
function isErrnoCode(error, code) {
    return (error instanceof Error &&
        "code" in error &&
        error.code === code);
}
function isAnyErrnoCode(error, codes) {
    return codes.some((code) => isErrnoCode(error, code));
}
function isMissingFileError(error) {
    return isErrnoCode(error, "ENOENT");
}
function isAlreadyExistsError(error) {
    return isErrnoCode(error, "EEXIST");
}
function isZodParseError(error) {
    return error instanceof Error && error.name === "ZodError";
}
