Refactor: consolidate mergeRelayList into utils.mjs

- Moved `mergeRelayList` from `src/lock-ops.mjs` and `src/lock-publisher.mjs` to `src/utils.mjs`.
- Updated imports in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Added unit tests for `mergeRelayList` in `test/utils.test.mjs`.
- Restored `torch-config-test.json` which was deleted by the test suite.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-20 18:09:01 +00:00
1 parent 2b8a0c3d0d
commit f54c540070
4 files changed
+24 -10

No files matched your search

+4
View File
@@ -42,6 +42,10 @@ export function detectPlatform() {
return null;
}
export function mergeRelayList(primaryRelays, fallbackRelays) {
return [...new Set([...primaryRelays, ...fallbackRelays])];
}
export function ensureDir(dir) {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });