@riddix/hamh 2.1.0-alpha.683 → 2.1.0-alpha.684

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.
@@ -148433,6 +148433,15 @@ function bridgeIconApi(storageLocation) {
148433
148433
  res.json({ success: true, iconUrl });
148434
148434
  }
148435
148435
  );
148436
+ router.get(
148437
+ "/:bridgeId/exists",
148438
+ (req, res) => {
148439
+ const bridgeId = req.params.bridgeId;
148440
+ const files = fs2.readdirSync(iconsDir);
148441
+ const exists = files.some((f) => f.startsWith(`${bridgeId}.`));
148442
+ res.json({ exists });
148443
+ }
148444
+ );
148436
148445
  router.get("/:bridgeId", (req, res) => {
148437
148446
  const bridgeId = req.params.bridgeId;
148438
148447
  const files = fs2.readdirSync(iconsDir);
@@ -148456,16 +148465,6 @@ function bridgeIconApi(storageLocation) {
148456
148465
  fs2.unlinkSync(filePath);
148457
148466
  res.json({ success: true });
148458
148467
  });
148459
- router.head("/:bridgeId", (req, res) => {
148460
- const bridgeId = req.params.bridgeId;
148461
- const files = fs2.readdirSync(iconsDir);
148462
- const iconFile = files.find((f) => f.startsWith(`${bridgeId}.`));
148463
- if (iconFile) {
148464
- res.status(200).end();
148465
- } else {
148466
- res.status(404).end();
148467
- }
148468
- });
148469
148468
  return router;
148470
148469
  }
148471
148470