_comuns/dist-back/tipoFiltro.26.js
2026-02-17 11:18:39 -03:00

72 lines
2.4 KiB
JavaScript

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var tipoFiltro_26_exports = {};
__export(tipoFiltro_26_exports, {
agrupadores26: () => agrupadores26,
criarFiltro26: () => criarFiltro26,
operadores26: () => operadores26,
zFiltro26: () => zFiltro26
});
module.exports = __toCommonJS(tipoFiltro_26_exports);
var import_zod = require("zod");
var operadores26 = /* @__PURE__ */ ((operadores262) => {
operadores262["="] = "=";
operadores262["!="] = "!=";
operadores262[">"] = ">";
operadores262[">="] = ">=";
operadores262["<"] = "<";
operadores262["<="] = "<=";
operadores262["like"] = "like";
operadores262["in"] = "in";
return operadores262;
})(operadores26 || {});
var agrupadores26 = /* @__PURE__ */ ((agrupadores262) => {
agrupadores262["E"] = "E";
agrupadores262["OU"] = "OU";
return agrupadores262;
})(agrupadores26 || {});
const zOperadores = import_zod.z.nativeEnum(operadores26);
const zValor = import_zod.z.any();
const zCondicao = import_zod.z.record(zOperadores, zValor);
const zFiltro26 = import_zod.z.lazy(
() => import_zod.z.object({
E: import_zod.z.array(zFiltro26).optional(),
OU: import_zod.z.array(zFiltro26).optional()
}).catchall(import_zod.z.union([zCondicao, zFiltro26]))
);
const criarFiltro26 = (filtro) => filtro;
const _filtro = criarFiltro26({
idade: { [">=" /* >= */]: 18 },
["OU" /* OU */]: [
{ nome: { ["like" /* like */]: "%pa%" } },
{
["E" /* E */]: [
{ carro: { ano: { ["=" /* = */]: 2020 } } },
{ carro: { modelo: { ["in" /* in */]: ["Civic", "Corolla"] } } }
]
}
]
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
agrupadores26,
criarFiltro26,
operadores26,
zFiltro26
});