mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-13 08:12:31 +00:00
refactor: deduplicate HEX64_REGEX to js/utils/hex.js
Moves the repeatedly defined HEX64_REGEX constant to a shared utility module to improve maintainability and consistency. Updates all consumers to import from the new location. Signed-off-by: Jules <[email protected]> Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
22fcc97672
commit
a084bb59de
23 files changed
+43
-23
No files matched your search
@@ -27,6 +27,7 @@ import getDefaultAuthProvider, {
|
||||
providers as defaultAuthProviders,
|
||||
} from "./authProviders/index.js";
|
||||
import { fetchProfileMetadata } from "./profileMetadataService.js";
|
||||
import { HEX64_REGEX } from "../utils/hex.js";
|
||||
|
||||
class SimpleEventEmitter {
|
||||
constructor(logger = null) {
|
||||
@@ -69,7 +70,7 @@ class SimpleEventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
const HEX64_REGEX = /^[0-9a-f]{64}$/i;
|
||||
|
||||
const FALLBACK_PROFILE = {
|
||||
name: "Unknown",
|
||||
picture: "assets/svg/default-profile.svg",
|
||||
|
||||
@@ -30,10 +30,11 @@ import {
|
||||
getLastSuccessfulScheme,
|
||||
setLastSuccessfulScheme,
|
||||
} from "../nostr/decryptionSchemeCache.js";
|
||||
import { HEX64_REGEX } from "../utils/hex.js";
|
||||
|
||||
const LOG_PREFIX = "[HashtagPreferences]";
|
||||
const HASHTAG_IDENTIFIER = "bitvid:tag-preferences";
|
||||
const HEX64_REGEX = /^[0-9a-f]{64}$/i;
|
||||
|
||||
const DEFAULT_VERSION = 1;
|
||||
const DECRYPT_TIMEOUT_MS = 20000;
|
||||
// PERF: Reduced from 10s to 3s for faster recovery during login.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { nostrClient } from "../nostrClientFacade.js";
|
||||
import { devLogger } from "../utils/logger.js";
|
||||
import { relaySubscriptionService } from "./relaySubscriptionService.js";
|
||||
import { HEX64_REGEX } from "../utils/hex.js";
|
||||
|
||||
const DEFAULT_PROFILE_IMAGE = "assets/svg/default-profile.svg";
|
||||
const HEX64_REGEX = /^[0-9a-f]{64}$/i;
|
||||
|
||||
const inFlight = new Map();
|
||||
|
||||
function normalizePubkey(pubkey) {
|
||||
|
||||
Reference in new issue
Block a user