* Bump deps

* Cleanups
This commit is contained in:
Jaco
2023-08-18 10:31:41 +03:00
committed by GitHub
parent cfdef1e760
commit 9c19e5f16a
7 changed files with 878 additions and 627 deletions
+3 -3
View File
@@ -21,9 +21,9 @@
"version": "0.21.6-298-x",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/x-fetch": "^12.3.2",
"@polkadot/util": "^12.4.1",
"@polkadot/util-crypto": "^12.4.1",
"@polkadot/x-fetch": "^12.4.1",
"tslib": "^2.6.0"
},
"devDependencies": {
+2 -2
View File
@@ -64,7 +64,7 @@ function checkTag (url: string, tag: string, attr?: string): Promise<[string, st
const match = new RegExp(`<${tag}${attr ? ` ${attr}` : ''}>(.*?)</${tag}>`, 'g').exec(result);
// /<\/?p( id="trnsctin")?>/g
return match && match.length
return match?.length
? match.map((v) =>
v
.replace(new RegExp(`</?${tag}${attr ? `( ${attr})?` : ''}>`, 'g'), '')
@@ -84,7 +84,7 @@ function checkAttr (url: string, attr: string): Promise<[string, string[]]> {
const result = await fetchText(url, TIMEOUT);
const match = new RegExp(`${attr}"[a-zA-Z0-9]+"`, 'g').exec(result);
return match && match.length
return match?.length
? [match[0].replace(new RegExp(attr, 'g'), '').replace(/"/g, '').trim()]
: null;
});
+1 -1
View File
@@ -156,7 +156,7 @@ export async function checkAddress (address: string | Uint8Array, allowCached =
u8as.some((a) => u8aEq(a, u8a))
);
return (entry && entry[0]) || null;
return entry?.[0] || null;
} catch {
return null;
}