igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
102 lines (101 loc) • 2.62 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result) __defProp(target, key, result);
return result;
};
import "reflect-metadata";
import { Expose, Type } from "class-transformer";
import ClrMamePro from "./clrMamePro.js";
class Header {
name;
description;
version;
date;
author;
url;
comment;
clrMamePro;
constructor(options) {
this.name = options?.name ?? "";
this.description = options?.description;
this.version = options?.version;
this.date = options?.date;
this.author = options?.author;
this.url = options?.url;
this.comment = options?.comment;
this.clrMamePro = options?.clrMamePro;
}
/**
* Create an XML object, to be used by the owning {@link DAT}.
*/
toXmlDatObj() {
return Object.fromEntries(
Object.entries({
name: this.name,
description: this.description,
version: this.version,
date: this.date,
author: this.author,
url: this.url,
comment: this.comment
}).filter(([, val]) => val !== void 0)
);
}
// Property getters
getName() {
return this.name;
}
getDescription() {
return this.description;
}
getVersion() {
return this.version;
}
getComment() {
return this.comment;
}
getClrMamePro() {
return this.clrMamePro;
}
// Computed getters
/**
* Return a string representation of this {@link Header}.
*/
toString() {
return JSON.stringify(this, void 0, 2);
}
}
__decorateClass([
Expose({ name: "name" })
], Header.prototype, "name", 2);
__decorateClass([
Expose({ name: "description" })
], Header.prototype, "description", 2);
__decorateClass([
Expose({ name: "version" })
], Header.prototype, "version", 2);
__decorateClass([
Expose({ name: "date" })
], Header.prototype, "date", 2);
__decorateClass([
Expose({ name: "author" })
], Header.prototype, "author", 2);
__decorateClass([
Expose({ name: "url" })
], Header.prototype, "url", 2);
__decorateClass([
Expose({ name: "comment" })
], Header.prototype, "comment", 2);
__decorateClass([
Type(() => ClrMamePro),
Expose({ name: "clrmamepro" })
], Header.prototype, "clrMamePro", 2);
export {
Header as default
};
//# sourceMappingURL=header.js.map