mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-06 21:01:54 +00:00
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:
1 parent
2b8a0c3d0d
commit
f54c540070
4 files changed
+24
-10
No files matched your search
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user