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>
20 lines
551 B
Text
20 lines
551 B
Text
export class Fields {
|
|
entries = {};
|
|
encoding;
|
|
constructor({ fields = [], encoding = "utf-8" }) {
|
|
fields.forEach(this.setField.bind(this));
|
|
this.encoding = encoding;
|
|
}
|
|
setField(field) {
|
|
this.entries[field.name.toLowerCase()] = field;
|
|
}
|
|
getField(name) {
|
|
return this.entries[name.toLowerCase()];
|
|
}
|
|
removeField(name) {
|
|
delete this.entries[name.toLowerCase()];
|
|
}
|
|
getByType(kind) {
|
|
return Object.values(this.entries).filter((field) => field.kind === kind);
|
|
}
|
|
}
|