mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
update
This commit is contained in:
1 parent
5a0b35ff60
commit
a52e1e2a17
1 file changed
+19
-20
+19
-20
@@ -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()) {
|
||||
|
||||
Reference in new issue
Block a user