@featurevisor/core
Version:
Core package of Featurevisor for Node.js usage
30 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttributeZodSchema = getAttributeZodSchema;
const zod_1 = require("zod");
function getAttributeZodSchema() {
const propertySchema = zod_1.z.object({
type: zod_1.z.enum([
"boolean",
"string",
"integer",
"double",
"date",
"semver",
"array",
// @NOTE: intentionally ignored for now to not allow nesting
// "object",
]),
description: zod_1.z.string().optional(),
});
const attributeZodSchema = zod_1.z
.object({
archived: zod_1.z.boolean().optional(),
type: zod_1.z.enum(["boolean", "string", "integer", "double", "date", "semver", "object", "array"]),
description: zod_1.z.string(),
properties: zod_1.z.record(zod_1.z.string(), propertySchema).optional(),
})
.strict();
return attributeZodSchema;
}
//# sourceMappingURL=attributeSchema.js.map