@zthun/romulator-client 1.7.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -247,15 +247,12 @@ function isMediaType(candidate) {
247
247
  */ var ZRomulatorSystemId = /*#__PURE__*/ function(ZRomulatorSystemId) {
248
248
  ZRomulatorSystemId["ThreeDo"] = "3do";
249
249
  ZRomulatorSystemId["Adam"] = "adam";
250
- ZRomulatorSystemId["AGS"] = "ags";
251
250
  ZRomulatorSystemId["Amiga"] = "amiga";
252
251
  ZRomulatorSystemId["Amiga1200"] = "amiga1200";
253
252
  ZRomulatorSystemId["Amiga600"] = "amiga600";
254
253
  ZRomulatorSystemId["AmigaCd32"] = "amigacd32";
255
254
  ZRomulatorSystemId["AmstradCpc"] = "amstradcpc";
256
255
  ZRomulatorSystemId["Android"] = "android";
257
- ZRomulatorSystemId["AndroidApps"] = "androidapps";
258
- ZRomulatorSystemId["AndroidGames"] = "androidgames";
259
256
  ZRomulatorSystemId["Apple2"] = "apple2";
260
257
  ZRomulatorSystemId["Apple2Gs"] = "apple2gs";
261
258
  ZRomulatorSystemId["Arcade"] = "arcade";
@@ -271,37 +268,29 @@ function isMediaType(candidate) {
271
268
  ZRomulatorSystemId["AtariJaguarCd"] = "atarijaguarcd";
272
269
  ZRomulatorSystemId["AtariLynx"] = "atarilynx";
273
270
  ZRomulatorSystemId["AtariSt"] = "atarist";
274
- ZRomulatorSystemId["AtariXe"] = "atarixe";
275
271
  ZRomulatorSystemId["Atomiswave"] = "atomiswave";
276
272
  ZRomulatorSystemId["BbcMicro"] = "bbcmicro";
277
273
  ZRomulatorSystemId["C64"] = "c64";
278
274
  ZRomulatorSystemId["CdiMono1"] = "cdimono1";
279
275
  ZRomulatorSystemId["Cdtv"] = "cdtv";
280
- ZRomulatorSystemId["ChaiLove"] = "chailove";
281
276
  ZRomulatorSystemId["ChannelF"] = "channelf";
282
277
  ZRomulatorSystemId["Coco"] = "coco";
283
278
  ZRomulatorSystemId["Colecovision"] = "colecovision";
284
- ZRomulatorSystemId["ConsoleArcade"] = "consolearcade";
285
279
  ZRomulatorSystemId["Cps"] = "cps";
286
280
  ZRomulatorSystemId["Cps1"] = "cps1";
287
281
  ZRomulatorSystemId["Cps2"] = "cps2";
288
282
  ZRomulatorSystemId["Cps3"] = "cps3";
289
283
  ZRomulatorSystemId["CrVision"] = "crvision";
290
284
  ZRomulatorSystemId["Daphne"] = "daphne";
291
- ZRomulatorSystemId["Desktop"] = "desktop";
292
- ZRomulatorSystemId["Doom"] = "doom";
293
285
  ZRomulatorSystemId["Dos"] = "dos";
294
286
  ZRomulatorSystemId["Dragon32"] = "dragon32";
295
287
  ZRomulatorSystemId["Dreamcast"] = "dreamcast";
296
288
  ZRomulatorSystemId["EasyRpg"] = "easyrpg";
297
289
  ZRomulatorSystemId["Electron"] = "electron";
298
- ZRomulatorSystemId["Emulators"] = "emulators";
299
- ZRomulatorSystemId["Epic"] = "epic";
300
290
  ZRomulatorSystemId["Famicom"] = "famicom";
301
291
  ZRomulatorSystemId["FBA"] = "fba";
302
292
  ZRomulatorSystemId["FBNeo"] = "fbneo";
303
293
  ZRomulatorSystemId["FDS"] = "fds";
304
- ZRomulatorSystemId["Flash"] = "flash";
305
294
  ZRomulatorSystemId["FM7"] = "fm7";
306
295
  ZRomulatorSystemId["FMTowns"] = "fmtowns";
307
296
  ZRomulatorSystemId["FPinball"] = "fpinball";
@@ -317,12 +306,7 @@ function isMediaType(candidate) {
317
306
  ZRomulatorSystemId["GMaster"] = "gmaster";
318
307
  ZRomulatorSystemId["GX4000"] = "gx4000";
319
308
  ZRomulatorSystemId["Intellivision"] = "intellivision";
320
- ZRomulatorSystemId["J2ME"] = "j2me";
321
- ZRomulatorSystemId["Kodi"] = "kodi";
322
- ZRomulatorSystemId["Laserdisc"] = "laserdisc";
323
- ZRomulatorSystemId["LcdGames"] = "lcdgames";
324
309
  ZRomulatorSystemId["LowResNx"] = "lowresnx";
325
- ZRomulatorSystemId["Lutris"] = "lutris";
326
310
  ZRomulatorSystemId["Lutro"] = "lutro";
327
311
  ZRomulatorSystemId["Macintosh"] = "macintosh";
328
312
  ZRomulatorSystemId["Mame"] = "mame";
@@ -330,20 +314,16 @@ function isMediaType(candidate) {
330
314
  ZRomulatorSystemId["Mark3"] = "mark3";
331
315
  ZRomulatorSystemId["MasterSystem"] = "mastersystem";
332
316
  ZRomulatorSystemId["MegaCd"] = "megacd";
333
- ZRomulatorSystemId["MegaCdJp"] = "megacdjp";
334
317
  ZRomulatorSystemId["MegaDrive"] = "megadrive";
335
318
  ZRomulatorSystemId["MegaDriveJp"] = "megadrivejp";
336
319
  ZRomulatorSystemId["MegaDuck"] = "megaduck";
337
320
  ZRomulatorSystemId["MESS"] = "mess";
338
321
  ZRomulatorSystemId["Model2"] = "model2";
339
322
  ZRomulatorSystemId["Model3"] = "model3";
340
- ZRomulatorSystemId["Moto"] = "moto";
341
323
  ZRomulatorSystemId["MSX"] = "msx";
342
324
  ZRomulatorSystemId["MSX1"] = "msx1";
343
325
  ZRomulatorSystemId["MSX2"] = "msx2";
344
326
  ZRomulatorSystemId["MSXTurbor"] = "msxturbor";
345
- ZRomulatorSystemId["Mugen"] = "mugen";
346
- ZRomulatorSystemId["Multivision"] = "multivision";
347
327
  ZRomulatorSystemId["N3DS"] = "n3ds";
348
328
  ZRomulatorSystemId["Nintendo64"] = "n64";
349
329
  ZRomulatorSystemId["N64DD"] = "n64dd";
@@ -365,14 +345,12 @@ function isMediaType(candidate) {
365
345
  ZRomulatorSystemId["PC"] = "pc";
366
346
  ZRomulatorSystemId["PC88"] = "pc88";
367
347
  ZRomulatorSystemId["PC98"] = "pc98";
368
- ZRomulatorSystemId["PcArcade"] = "pcarcade";
369
348
  ZRomulatorSystemId["PcEngine"] = "pcengine";
370
349
  ZRomulatorSystemId["PcEngineCd"] = "pcenginecd";
371
350
  ZRomulatorSystemId["PCFx"] = "pcfx";
372
351
  ZRomulatorSystemId["Pico8"] = "pico8";
373
352
  ZRomulatorSystemId["Plus4"] = "plus4";
374
353
  ZRomulatorSystemId["PokeMini"] = "pokemini";
375
- ZRomulatorSystemId["Ports"] = "ports";
376
354
  ZRomulatorSystemId["PS2"] = "ps2";
377
355
  ZRomulatorSystemId["PS3"] = "ps3";
378
356
  ZRomulatorSystemId["PS4"] = "ps4";
@@ -380,7 +358,6 @@ function isMediaType(candidate) {
380
358
  ZRomulatorSystemId["PSVita"] = "psvita";
381
359
  ZRomulatorSystemId["PSX"] = "psx";
382
360
  ZRomulatorSystemId["PV1000"] = "pv1000";
383
- ZRomulatorSystemId["Quake"] = "quake";
384
361
  ZRomulatorSystemId["SamCoupe"] = "samcoupe";
385
362
  ZRomulatorSystemId["Satellaview"] = "satellaview";
386
363
  ZRomulatorSystemId["Saturn"] = "saturn";
@@ -388,31 +365,23 @@ function isMediaType(candidate) {
388
365
  ZRomulatorSystemId["ScummVM"] = "scummvm";
389
366
  ZRomulatorSystemId["SCV"] = "scv";
390
367
  ZRomulatorSystemId["Sega32X"] = "sega32x";
391
- ZRomulatorSystemId["Sega32XJp"] = "sega32xjp";
392
- ZRomulatorSystemId["Sega32XNa"] = "sega32xna";
393
368
  ZRomulatorSystemId["SegaCd"] = "segacd";
394
- ZRomulatorSystemId["SFC"] = "sfc";
395
369
  ZRomulatorSystemId["Sg1000"] = "sg-1000";
396
370
  ZRomulatorSystemId["SGB"] = "sgb";
397
371
  ZRomulatorSystemId["SuperNintendo"] = "snes";
398
- ZRomulatorSystemId["SnesNa"] = "snesna";
399
372
  ZRomulatorSystemId["Solarus"] = "solarus";
400
373
  ZRomulatorSystemId["SpectraVideo"] = "spectravideo";
401
- ZRomulatorSystemId["Steam"] = "steam";
402
374
  ZRomulatorSystemId["STV"] = "stv";
403
375
  ZRomulatorSystemId["Sufami"] = "sufami";
404
376
  ZRomulatorSystemId["SuperGrafx"] = "supergrafx";
405
377
  ZRomulatorSystemId["SuperVision"] = "supervision";
406
378
  ZRomulatorSystemId["SupraCan"] = "supracan";
407
379
  ZRomulatorSystemId["Switch"] = "switch";
408
- ZRomulatorSystemId["Symbian"] = "symbian";
409
- ZRomulatorSystemId["TanoDragon"] = "tanodragon";
410
380
  ZRomulatorSystemId["TgCd"] = "tg-cd";
411
381
  ZRomulatorSystemId["TG16"] = "tg16";
412
382
  ZRomulatorSystemId["TI99"] = "ti99";
413
383
  ZRomulatorSystemId["TIC80"] = "tic80";
414
384
  ZRomulatorSystemId["TO8"] = "to8";
415
- ZRomulatorSystemId["Triforce"] = "triforce";
416
385
  ZRomulatorSystemId["TRS80"] = "trs-80";
417
386
  ZRomulatorSystemId["TypeX"] = "type-x";
418
387
  ZRomulatorSystemId["Uzebox"] = "uzebox";
@@ -438,7 +407,6 @@ function isMediaType(candidate) {
438
407
  ZRomulatorSystemId["XboxOne"] = "xboxone";
439
408
  ZRomulatorSystemId["ZMachine"] = "zmachine";
440
409
  ZRomulatorSystemId["Zx81"] = "zx81";
441
- ZRomulatorSystemId["ZxNext"] = "zxnext";
442
410
  ZRomulatorSystemId["ZxSpectrum"] = "zxspectrum";
443
411
  return ZRomulatorSystemId;
444
412
  }({});
@@ -517,49 +485,92 @@ const ZRomulatorSystemIdMap = lodashEs.keyBy(Object.values(ZRomulatorSystemId));
517
485
  }
518
486
 
519
487
  /**
520
- * Describes a type of system.
521
- */ var ZRomulatorSystemType = /*#__PURE__*/ function(ZRomulatorSystemType) {
488
+ * The type of media content for a system.
489
+ */ var ZRomulatorSystemContentType = /*#__PURE__*/ function(ZRomulatorSystemContentType) {
490
+ /**
491
+ * Uses memory roms.
492
+ */ ZRomulatorSystemContentType["ReadOnlyMemory"] = "rom";
493
+ /**
494
+ * Folder based game with a known structure.
495
+ */ ZRomulatorSystemContentType["Folder"] = "folder";
496
+ /**
497
+ * Executable file.
498
+ */ ZRomulatorSystemContentType["File"] = "file";
499
+ /**
500
+ * Spinning disk media.
501
+ */ ZRomulatorSystemContentType["Disk"] = "iso";
502
+ return ZRomulatorSystemContentType;
503
+ }({});
504
+
505
+ /**
506
+ * Describes the type of hardware a system is.
507
+ */ var ZRomulatorSystemHardwareType = /*#__PURE__*/ function(ZRomulatorSystemHardwareType) {
522
508
  /**
523
509
  * An accessory that attaches to another system.
524
- */ ZRomulatorSystemType["Accessory"] = "accessory";
510
+ */ ZRomulatorSystemHardwareType["Accessory"] = "accessory";
525
511
  /**
526
512
  * A cabinet system
527
- */ ZRomulatorSystemType["Arcade"] = "arcade";
513
+ */ ZRomulatorSystemHardwareType["Arcade"] = "arcade";
528
514
  /**
529
515
  * Known computer systems
530
- */ ZRomulatorSystemType["Computer"] = "computer";
516
+ */ ZRomulatorSystemHardwareType["Computer"] = "computer";
531
517
  /**
532
518
  * A console system.
533
- */ ZRomulatorSystemType["Console"] = "console";
519
+ */ ZRomulatorSystemHardwareType["Console"] = "console";
534
520
  /**
535
521
  * Pinball
536
- */ ZRomulatorSystemType["Flipper"] = "flipper";
522
+ */ ZRomulatorSystemHardwareType["Flipper"] = "flipper";
537
523
  /**
538
524
  * A handheld system
539
- */ ZRomulatorSystemType["Handheld"] = "console-portable";
525
+ */ ZRomulatorSystemHardwareType["Handheld"] = "console-portable";
540
526
  /**
541
527
  * Script Creation Utility.
542
- */ ZRomulatorSystemType["ScummVm"] = "scummvm";
528
+ */ ZRomulatorSystemHardwareType["ScummVm"] = "scummvm";
543
529
  /**
544
530
  * Phone based system
545
- */ ZRomulatorSystemType["Smartphone"] = "smartphone";
531
+ */ ZRomulatorSystemHardwareType["Smartphone"] = "smartphone";
546
532
  /**
547
533
  * Virtual machine based system.
548
- */ ZRomulatorSystemType["VirtualMachine"] = "virtual-machine";
549
- return ZRomulatorSystemType;
534
+ */ ZRomulatorSystemHardwareType["VirtualMachine"] = "virtual-machine";
535
+ return ZRomulatorSystemHardwareType;
536
+ }({});
537
+
538
+ /**
539
+ * The type of media a system supports.
540
+ */ var ZRomulatorSystemMediaFormatType = /*#__PURE__*/ function(ZRomulatorSystemMediaFormatType) {
541
+ /**
542
+ * Cartridge based systems.
543
+ */ ZRomulatorSystemMediaFormatType["Cartridge"] = "cartridge";
544
+ /**
545
+ * Motherboard based systems.
546
+ *
547
+ * Usually for arcades.
548
+ */ ZRomulatorSystemMediaFormatType["Pcb"] = "pcb";
549
+ /**
550
+ * CD/DVD based systems.
551
+ */ ZRomulatorSystemMediaFormatType["Cd"] = "cd";
552
+ /**
553
+ * Floppy disk based systems.
554
+ */ ZRomulatorSystemMediaFormatType["FloppyDisk"] = "floppy-disk";
555
+ return ZRomulatorSystemMediaFormatType;
550
556
  }({});
551
557
 
552
558
  /**
553
559
  * A builder for creating an IZRomulatorSystem.
554
560
  */ class ZRomulatorSystemBuilder {
555
561
  _system = {
556
- id: ZRomulatorSystemId.Nintendo
562
+ id: ZRomulatorSystemId.Nintendo,
563
+ extensions: [
564
+ "zip",
565
+ "7z"
566
+ ]
557
567
  };
558
568
  /**
559
569
  * Sets the id (slug) of the system.
560
570
  *
561
571
  * @param id -
562
572
  * The unique identifier for the system.
573
+ *
563
574
  * @returns
564
575
  * This instance.
565
576
  */ id(id) {
@@ -571,6 +582,7 @@ const ZRomulatorSystemIdMap = lodashEs.keyBy(Object.values(ZRomulatorSystemId));
571
582
  *
572
583
  * @param name -
573
584
  * The canonical name of the system.
585
+ *
574
586
  * @returns
575
587
  * This instance.
576
588
  */ name(name) {
@@ -578,73 +590,116 @@ const ZRomulatorSystemIdMap = lodashEs.keyBy(Object.values(ZRomulatorSystemId));
578
590
  return this;
579
591
  }
580
592
  /**
581
- * Sets the system type.
593
+ * Sets the company that published the system.
594
+ *
595
+ * @param name -
596
+ * The name of the company.
582
597
  *
583
- * @param type -
584
- * The type of system.
585
598
  * @returns
586
599
  * This instance.
587
- */ type(type) {
588
- this._system.type = type;
600
+ */ company(name) {
601
+ this._system.company = name;
589
602
  return this;
590
603
  }
591
604
  /**
592
- * Sets the system type to console.
605
+ * Sets the system hardware type.
593
606
  *
594
- * @returns
595
- * This instance.
596
- */ console = this.type.bind(this, ZRomulatorSystemType.Console);
597
- /**
598
- * Sets the system type to handheld.
607
+ * @param type -
608
+ * The system hardware type.
599
609
  *
600
610
  * @returns
601
611
  * This instance.
602
- */ handheld = this.type.bind(this, ZRomulatorSystemType.Handheld);
612
+ */ hardware(type) {
613
+ this._system.classification = helpfulFn.firstDefined({}, this._system.classification);
614
+ this._system.classification.hardwareType = type;
615
+ return this;
616
+ }
603
617
  /**
604
- * Sets the system type to arcade.
618
+ * Sets the system media format.
605
619
  *
606
- * @returns
607
- * This instance.
608
- */ arcade = this.type.bind(this, ZRomulatorSystemType.Arcade);
609
- /**
610
- * Sets the system type to computer.
620
+ * @param type -
621
+ * The system media format.
611
622
  *
612
623
  * @returns
613
624
  * This instance.
614
- */ computer = this.type.bind(this, ZRomulatorSystemType.Computer);
625
+ */ mediaFormat(type) {
626
+ this._system.classification = helpfulFn.firstDefined({}, this._system.classification);
627
+ this._system.classification.mediaFormat = type;
628
+ return this;
629
+ }
615
630
  /**
616
- * Sets the generational index of the system.
631
+ * Sets the system content type.
632
+ *
633
+ * @param type -
634
+ * The system content type.
617
635
  *
618
- * @param generation -
619
- * The generational index of the system.
620
636
  * @returns
621
637
  * This instance.
622
- */ generation(generation) {
623
- this._system.generation = generation;
638
+ */ contentType(type) {
639
+ this._system.classification = helpfulFn.firstDefined({}, this._system.classification);
640
+ this._system.classification.contentType = type;
624
641
  return this;
625
642
  }
626
643
  /**
627
- * Assigns system data to this system.
644
+ * Sets the production run.
628
645
  *
629
- * @param system -
630
- * The partial system data to assign.
646
+ * @param start -
647
+ * The starting year of production.
648
+ * @param end -
649
+ * The last year of production.
631
650
  *
632
651
  * @returns
633
652
  * This object.
634
- */ assign(system) {
635
- this._system = {
636
- ...this._system,
637
- ...system
653
+ */ production(start, end) {
654
+ delete this._system.productionYears;
655
+ this._system.productionYears = {
656
+ start,
657
+ end
638
658
  };
659
+ this._system.productionYears = lodashEs.omitBy(this._system.productionYears, lodashEs.isUndefined);
639
660
  return this;
640
661
  }
641
662
  /**
642
- * Removes anything that is not a valid property on this object.
643
- */ redact() {
644
- this._system = lodashEs.pick(this._system, "id", "name", "generation", "type");
663
+ * Adds to the extension list.
664
+ *
665
+ * @param extension -
666
+ * The extension or list of extensions to add.
667
+ *
668
+ * @returns
669
+ * This object.
670
+ */ extension(extension) {
671
+ const extensions = helpfulFn.firstDefined([], this._system.extensions);
672
+ this._system.extensions = lodashEs.uniqBy(extensions.concat(extension), lodashEs.upperCase).map((e)=>e.toLowerCase());
645
673
  return this;
646
674
  }
647
675
  /**
676
+ * Parses an unknown object to try and build a system from it.
677
+ *
678
+ * @param candidate -
679
+ * The candidate to try and parse.
680
+ *
681
+ * @returns
682
+ * This object.
683
+ */ parse(candidate) {
684
+ if (candidate == null || typeof candidate !== "object") {
685
+ return this;
686
+ }
687
+ const id = lodashEs.get(candidate, "id");
688
+ const name = lodashEs.get(candidate, "name");
689
+ const company = lodashEs.get(candidate, "company");
690
+ const extensions = lodashEs.castArray(lodashEs.get(candidate, "extensions")).filter((ext)=>ext != null).filter((ext)=>typeof ext === "string");
691
+ if (isSystemId(id)) {
692
+ this.id(id);
693
+ }
694
+ if (name != null && typeof name === "string") {
695
+ this.name(name);
696
+ }
697
+ if (company != null && typeof company === "string") {
698
+ this.company(company);
699
+ }
700
+ return this.extension(extensions);
701
+ }
702
+ /**
648
703
  * Builds the system instance.
649
704
  *
650
705
  * @returns
@@ -663,9 +718,11 @@ exports.ZRomulatorGameBuilder = ZRomulatorGameBuilder;
663
718
  exports.ZRomulatorGameMediaType = ZRomulatorGameMediaType;
664
719
  exports.ZRomulatorMediaBuilder = ZRomulatorMediaBuilder;
665
720
  exports.ZRomulatorSystemBuilder = ZRomulatorSystemBuilder;
721
+ exports.ZRomulatorSystemContentType = ZRomulatorSystemContentType;
722
+ exports.ZRomulatorSystemHardwareType = ZRomulatorSystemHardwareType;
666
723
  exports.ZRomulatorSystemId = ZRomulatorSystemId;
724
+ exports.ZRomulatorSystemMediaFormatType = ZRomulatorSystemMediaFormatType;
667
725
  exports.ZRomulatorSystemMediaType = ZRomulatorSystemMediaType;
668
- exports.ZRomulatorSystemType = ZRomulatorSystemType;
669
726
  exports.isGameMediaType = isGameMediaType;
670
727
  exports.isMediaType = isMediaType;
671
728
  exports.isSystemId = isSystemId;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/game/game.mts","../src/media/media-type.mts","../src/system/system-id.mts","../src/media/media.mts","../src/system/system-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { isUndefined, omitBy } from \"lodash-es\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name?: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file?: string;\n\n /**\n * The system id that this game belongs to.\n */\n system?: ZRomulatorSystemId;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = { id: \"\" };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller.png\",\n /**\n * A icon for the system.\n *\n * These are normally 32x32.\n */\n Icon = \"icon.png\",\n /**\n * An illustration of the system.\n */\n Illustration = \"illustration.png\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture.png\",\n /**\n * A video trailer for the system.\n */\n Video = \"video.mp4\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel.png\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n AGS = \"ags\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n AndroidApps = \"androidapps\",\n AndroidGames = \"androidgames\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n AtariXe = \"atarixe\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChaiLove = \"chailove\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n ConsoleArcade = \"consolearcade\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Desktop = \"desktop\",\n Doom = \"doom\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Emulators = \"emulators\",\n Epic = \"epic\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n Flash = \"flash\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n J2ME = \"j2me\",\n Kodi = \"kodi\",\n Laserdisc = \"laserdisc\",\n LcdGames = \"lcdgames\",\n LowResNx = \"lowresnx\",\n Lutris = \"lutris\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaCdJp = \"megacdjp\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n Moto = \"moto\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n Mugen = \"mugen\",\n Multivision = \"multivision\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcArcade = \"pcarcade\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n Ports = \"ports\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n Quake = \"quake\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n Sega32XJp = \"sega32xjp\",\n Sega32XNa = \"sega32xna\",\n SegaCd = \"segacd\",\n SFC = \"sfc\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n SnesNa = \"snesna\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n Steam = \"steam\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n Symbian = \"symbian\",\n TanoDragon = \"tanodragon\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n Triforce = \"triforce\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxNext = \"zxnext\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(fileName) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(fileName).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","/**\n * Describes a type of system.\n */\nexport enum ZRomulatorSystemType {\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n","import { pick } from \"lodash-es\";\nimport { ZRomulatorSystemId } from \"./system-id.mjs\";\nimport { ZRomulatorSystemType } from \"./system-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE, for example, the id would map to\n * the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name?: string;\n /**\n * The generational index of the system.\n */\n generation?: number;\n /**\n * The type of system.\n */\n type?: ZRomulatorSystemType;\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n return this;\n }\n\n /**\n * Sets the system type.\n *\n * @param type -\n * The type of system.\n * @returns\n * This instance.\n */\n public type(type: ZRomulatorSystemType): this {\n this._system.type = type;\n return this;\n }\n\n /**\n * Sets the system type to console.\n *\n * @returns\n * This instance.\n */\n public console = this.type.bind(this, ZRomulatorSystemType.Console);\n\n /**\n * Sets the system type to handheld.\n *\n * @returns\n * This instance.\n */\n public handheld = this.type.bind(this, ZRomulatorSystemType.Handheld);\n\n /**\n * Sets the system type to arcade.\n *\n * @returns\n * This instance.\n */\n public arcade = this.type.bind(this, ZRomulatorSystemType.Arcade);\n\n /**\n * Sets the system type to computer.\n *\n * @returns\n * This instance.\n */\n public computer = this.type.bind(this, ZRomulatorSystemType.Computer);\n\n /**\n * Sets the generational index of the system.\n *\n * @param generation -\n * The generational index of the system.\n * @returns\n * This instance.\n */\n public generation(generation: number): this {\n this._system.generation = generation;\n return this;\n }\n\n /**\n * Assigns system data to this system.\n *\n * @param system -\n * The partial system data to assign.\n *\n * @returns\n * This object.\n */\n public assign(system: Partial<IZRomulatorSystem>) {\n this._system = { ...this._system, ...system };\n return this;\n }\n\n /**\n * Removes anything that is not a valid property on this object.\n */\n public redact() {\n this._system = pick(this._system, \"id\", \"name\", \"generation\", \"type\");\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","_config","games","copy","other","structuredClone","assign","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorGameBuilder","_game","system","clone","omitBy","isUndefined","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","keyBy","Object","values","ZRomulatorGameMediaTypeMap","isSystemMediaType","candidate","prototype","hasOwnProperty","call","isGameMediaType","isMediaType","ZRomulatorSystemId","ZRomulatorSystemIdMap","isSystemId","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorSystemType","ZRomulatorSystemBuilder","_system","Nintendo","console","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A,QAAQ,CAAE;AAEtE;;;;;AAKC,MACD,MAAOC,GAAS,IAAI,CAAC5B,IAAI,CAACwB,IAAI,CAAC,IAAI,EAAEL,oBAAqBU,CAAAA,MAAM,CAAE;AAElE;;;;;AAKC,MACD,QAAOC,GAAW,IAAI,CAAC9B,IAAI,CAACwB,IAAI,CAAC,IAAI,EAAEL,oBAAqBY,CAAAA,QAAQ,CAAE;AAEtE;;;;;;;MAQOC,UAAWA,CAAAA,UAAkB,EAAQ;AAC1C,QAAA,IAAI,CAACX,OAAO,CAACW,UAAU,GAAGA,UAAAA;AAC1B,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;MASOpE,MAAOa,CAAAA,MAAkC,EAAE;QAChD,IAAI,CAAC4C,OAAO,GAAG;YAAE,GAAG,IAAI,CAACA,OAAO;AAAE,YAAA,GAAG5C;AAAO,SAAA;AAC5C,QAAA,OAAO,IAAI;AACb;AAEA;;AAEC,MACD,MAAgB,GAAA;QACd,IAAI,CAAC4C,OAAO,GAAGY,aAAK,CAAA,IAAI,CAACZ,OAAO,EAAE,IAAM,EAAA,MAAA,EAAQ,YAAc,EAAA,MAAA,CAAA;AAC9D,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMC,MACD,KAAe,GAAA;QACb,OAAO1D,eAAAA,CAAgB,IAAI,CAAC0D,OAAO,CAAA;AACrC;AACF;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/game/game.mts","../src/media/media-type.mts","../src/system/system-id.mts","../src/media/media.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { isUndefined, omitBy } from \"lodash-es\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name?: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file?: string;\n\n /**\n * The system id that this game belongs to.\n */\n system?: ZRomulatorSystemId;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = { id: \"\" };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller.png\",\n /**\n * A icon for the system.\n *\n * These are normally 32x32.\n */\n Icon = \"icon.png\",\n /**\n * An illustration of the system.\n */\n Illustration = \"illustration.png\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture.png\",\n /**\n * A video trailer for the system.\n */\n Video = \"video.mp4\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel.png\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(fileName) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(fileName).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n","/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n","/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormatType {\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport {\n castArray,\n get,\n isUndefined,\n omitBy,\n uniqBy,\n upperCase,\n} from \"lodash-es\";\nimport type { ZRomulatorSystemContentType } from \"./system-content-type.mjs\";\nimport type { ZRomulatorSystemHardwareType } from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport type { ZRomulatorSystemMediaFormatType } from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name?: string;\n\n /**\n * The company that published the system.\n */\n company?: string;\n\n /**\n * Type classifications for the system.\n */\n classification?: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType?: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat?: ZRomulatorSystemMediaFormatType;\n\n /**\n * The digital format of the game media.\n */\n contentType?: ZRomulatorSystemContentType;\n };\n\n /**\n * The years the system was in production until.\n */\n productionYears?: {\n /**\n * The first year the system went into production.\n */\n start?: number;\n /**\n * The year when production stopped.\n */\n end?: number;\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n extensions: [\"zip\", \"7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification = firstDefined({}, this._system.classification);\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormatType): this {\n this._system.classification = firstDefined({}, this._system.classification);\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification = firstDefined({}, this._system.classification);\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(start: number, end?: number) {\n delete this._system.productionYears;\n this._system.productionYears = {\n start,\n end,\n };\n this._system.productionYears = omitBy(\n this._system.productionYears,\n isUndefined,\n );\n\n return this;\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const extensions = firstDefined([], this._system.extensions);\n this._system.extensions = uniqBy<string>(\n extensions.concat(extension),\n upperCase,\n ).map((e) => e.toLowerCase());\n\n return this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n const id = get(candidate, \"id\");\n const name = get(candidate, \"name\");\n const company = get(candidate, \"company\");\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\");\n\n if (isSystemId(id)) {\n this.id(id);\n }\n\n if (name != null && typeof name === \"string\") {\n this.name(name);\n }\n\n if (company != null && typeof company === \"string\") {\n this.company(company);\n }\n\n return this.extension(extensions);\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","_config","games","copy","other","structuredClone","assign","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorGameBuilder","_game","system","clone","omitBy","isUndefined","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","keyBy","Object","values","ZRomulatorGameMediaTypeMap","isSystemMediaType","candidate","prototype","hasOwnProperty","call","isGameMediaType","isMediaType","ZRomulatorSystemId","ZRomulatorSystemIdMap","isSystemId","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemMediaFormatType","ZRomulatorSystemBuilder","_system","Nintendo","extensions","company","hardware","classification","hardwareType","mediaFormat","contentType","production","start","end","productionYears","extension","uniqBy","upperCase","map","e","toLowerCase","parse","get","filter"],"mappings":";;;;;;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,6BACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;ACbO,MAAMC,4BAAAA,CAAAA;AACHC,IAAAA,OAAAA,GAAkC,EAAG;AAEtCV,IAAAA,WAAAA,CAAYW,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACD,O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D,OAAO,CAAA;AACrC;AACF;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.mts CHANGED
@@ -4,6 +4,8 @@ export * from './config/config.mjs';
4
4
  export * from './game/game.mjs';
5
5
  export * from './media/media-type.mjs';
6
6
  export * from './media/media.mjs';
7
+ export * from './system/system-content-type.mjs';
8
+ export * from './system/system-hardware-type.mjs';
7
9
  export * from './system/system-id.mjs';
8
- export * from './system/system-type.mjs';
10
+ export * from './system/system-media-format-type.mjs';
9
11
  export * from './system/system.mjs';