support skydb in hns

This commit is contained in:
Karol Wypchlo 2020-11-03 16:30:34 +01:00
parent a19a1ab602
commit 84e54f3311
1 changed files with 3 additions and 5 deletions

View File

@ -85,13 +85,11 @@ const resolveDomainHandler = async (req, res) => {
}; };
// Checks if the given string is a valid Sia link. // Checks if the given string is a valid Sia link.
function isValidSkylink(link) { function isValidSkylink(value) {
if (!link || link.length === 0) { return Boolean(value && value.match(startsWithSkylinkRegExp));
return false;
}
return Boolean(link.match(startsWithSkylinkRegExp));
} }
// Checks if given string is a valid skynet registry entry
function isValidRegistryEntry(value) { function isValidRegistryEntry(value) {
return Boolean(value && value.match(registryEntryRegExp)); return Boolean(value && value.match(registryEntryRegExp));
} }