Rocky_Mountain_Vending/.pnpm-store/v10/files/07/134c5c8206d0910ab6f9872cd559a213c2157c9ddc1128ee82915c0c4aa620d3dccd2ba4a9b9ce32b30ff2b43e993b98acf333bc6b49f5938c62b2772944f5
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

23 lines
573 B
Text

export class UnionSerde {
from;
to;
keys;
constructor(from, to) {
this.from = from;
this.to = to;
this.keys = new Set(Object.keys(this.from).filter((k) => k !== "__type"));
}
mark(key) {
this.keys.delete(key);
}
hasUnknown() {
return this.keys.size === 1 && Object.keys(this.to).length === 0;
}
writeUnknown() {
if (this.hasUnknown()) {
const k = this.keys.values().next().value;
const v = this.from[k];
this.to.$unknown = [k, v];
}
}
}