usb.ids 2.20251213.0 → 2.20260610.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/cli.js CHANGED
@@ -511,6 +511,9 @@ function resolveUpstreamMeta(rawContent, existing, strictHeader) {
511
511
  }
512
512
  //#endregion
513
513
  //#region ../sdk/src/repository/file-store.ts
514
+ function writeJsonFile(value, filePath) {
515
+ fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`, "utf8");
516
+ }
514
517
  async function saveRawUsbIdsFile(content, filePath) {
515
518
  try {
516
519
  fs.writeFileSync(filePath, content, "utf8");
@@ -520,16 +523,14 @@ async function saveRawUsbIdsFile(content, filePath) {
520
523
  }
521
524
  async function saveUsbIdsToFile(data, filePath) {
522
525
  try {
523
- const jsonContent = JSON.stringify(data, null, 2);
524
- fs.writeFileSync(filePath, jsonContent, "utf8");
526
+ writeJsonFile(data, filePath);
525
527
  } catch (error) {
526
528
  throw new Error(`Failed to save usb.ids JSON: ${error.message}`);
527
529
  }
528
530
  }
529
531
  async function saveVersionInfo(versionInfo, filePath) {
530
532
  try {
531
- const jsonContent = JSON.stringify(versionInfo, null, 2);
532
- fs.writeFileSync(filePath, jsonContent, "utf8");
533
+ writeJsonFile(versionInfo, filePath);
533
534
  } catch (error) {
534
535
  throw new Error(`Failed to save version file: ${error.message}`);
535
536
  }