Support both bare (no leading `sia://`) and full skylinks.
This commit is contained in:
parent
f896afada1
commit
98ec6f5c1c
|
@ -19,7 +19,8 @@ const clientOptions = {
|
||||||
};
|
};
|
||||||
const client = new NodeClient(clientOptions);
|
const client = new NodeClient(clientOptions);
|
||||||
|
|
||||||
const startsWithSkylinkRegExp = /^[a-zA-Z0-9_-]{46}/;
|
// Match both `sia://HASH` and `HASH` links.
|
||||||
|
const startsWithSkylinkRegExp = /^(sia:\/\/){0,1}[a-zA-Z0-9_-]{46}/;
|
||||||
|
|
||||||
const getDomainRecords = async (name) => {
|
const getDomainRecords = async (name) => {
|
||||||
const response = await client.execute("getnameresource", [name]);
|
const response = await client.execute("getnameresource", [name]);
|
||||||
|
|
Reference in New Issue