refactor(lock): centralize lock utility functions

- Moved `withTimeout` to `src/utils.mjs` and exported it.
- Updated `src/lock-utils.mjs` to re-export `withTimeout` and `mergeRelayList` from `src/utils.mjs`.
- Removed duplicate local definitions of `withTimeout` and `mergeRelayList` in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fixed `test/utils.test.mjs` to import `mergeRelayList`.
- Verified all tests pass with `npm test`.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-20 21:53:59 +00:00
1 parent 8d43fc1be8
commit 08d291e7fa
5 files changed
+14 -37

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ import { describe, it, after } from 'node:test';
import assert from 'node:assert';
import fs from 'node:fs';
import path from 'node:path';
import { getIsoWeekStr, todayDateStr, nowUnix, ensureDir, detectPlatform, relayListLabel } from '../src/utils.mjs';
import { getIsoWeekStr, todayDateStr, nowUnix, ensureDir, detectPlatform, relayListLabel, mergeRelayList } from '../src/utils.mjs';
describe('Date Utilities', () => {
describe('todayDateStr', () => {