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 +5 -4
- package/dist/data/usb.ids.compact.json +1 -1
- package/dist/data/usb.ids.min.json +1 -1
- package/dist/data/usb.ids.min.json.br +0 -0
- package/dist/data/usb.ids.min.json.gz +0 -0
- package/dist/data/usb.ids.version.json +11 -11
- package/dist/data/vendors/0a5c.json +1 -1
- package/dist/data/vendors.index.json +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/usb.ids +3 -2
- package/usb.ids.json +5 -1
- package/usb.ids.version.json +8 -8
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
|
-
|
|
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
|
-
|
|
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
|
}
|