This commit is contained in:
thePR0M3TH3AN committed 2025-11-03 22:07:49 -05:00
1 parent 5a0b35ff60
commit a52e1e2a17
1 file changed
+19 -20
+19 -20
View File
@@ -118,6 +118,25 @@ function normalizePointerCandidate(candidate, expectedType) {
};
}
if (
expectedType === "a" &&
typeof candidate.address === "string" &&
candidate.address.trim()
) {
return {
value: candidate.address.trim(),
relay: normalizeRelay(candidate),
};
}
if (candidate.tag) {
return normalizePointerCandidate(candidate.tag, expectedType);
}
if (candidate.pointer) {
return normalizePointerCandidate(candidate.pointer, expectedType);
}
}
return null;
}
function normalizeTagName(name) {
return typeof name === "string" ? name.trim().toLowerCase() : "";
@@ -162,26 +181,6 @@ function normalizeDescriptorRelay(value) {
}
expectedType === "a" &&
typeof candidate.address === "string" &&
candidate.address.trim()
) {
return {
value: candidate.address.trim(),
relay: normalizeRelay(candidate),
};
}
if (candidate.tag) {
return normalizePointerCandidate(candidate.tag, expectedType);
}
if (candidate.pointer) {
return normalizePointerCandidate(candidate.pointer, expectedType);
}
}
return null;
}
function pickString(...candidates) {
for (const candidate of candidates) {
if (typeof candidate === "string" && candidate.trim()) {