UNPKG

@gg-world/deals

Version:

Zod schemas and TypeScript types for deal-related data structures

21 lines (20 loc) 499 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Deal = void 0; const deal_1 = require("../schemas/deal"); class Deal { constructor(dealData) { // Validate and parse the input data this.data = deal_1.DealSchema.parse(dealData); } static isDeal(data) { return deal_1.DealSchema.safeParse(data).success; } toJSON() { return this.data; } get deal() { return this.data; } } exports.Deal = Deal;