* 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
+1 -1
View File
@@ -41,7 +41,7 @@
"dnslink-cloudflare": "^3.0.0"
},
"devDependencies": {
"@polkadot/dev": "^0.75.26",
"@polkadot/dev": "^0.76.15",
"@types/node": "^20.4.0"
},
"resolutions": {
+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;
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// Copyright 2017-2023 @polkadot/phishing authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { createBundle } from '@polkadot/dev/config/rollup';
+5 -5
View File
@@ -17,8 +17,8 @@ const PINMETA = {
/** @type {PinataClient} */
// @ts-expect-error For some reason we have issues here...
const pinata = new PinataSDK({
pinataApiKey: process.env.PINATA_API_KEY,
pinataSecretApiKey: process.env.PINATA_SECRET_KEY
pinataApiKey: process.env['PINATA_API_KEY'],
pinataSecretApiKey: process.env['PINATA_SECRET_KEY']
});
async function wait (delay = 2500) {
@@ -53,7 +53,7 @@ async function unpin (exclude) {
.map((r) => r.ipfs_pin_hash)
.filter((/** @type { string} */ hash) => hash !== exclude);
for (let i = 0; i < hashes.length; i++) {
for (let i = 0, count = hashes.length; i < count; i++) {
const hash = hashes[i];
try {
@@ -74,12 +74,12 @@ async function unpin (exclude) {
async function dnslink (hash) {
const records = [`_dnslink.${SUB_DOMAIN}.${DOMAIN}`];
for (let i = 0; i < records.length; i++) {
for (let i = 0, count = records.length; i < count; i++) {
const record = records[i];
try {
await cloudflare(
{ token: process.env.CF_API_TOKEN },
{ token: process.env['CF_API_TOKEN'] },
{ link: `/ipfs/${hash}`, record, zone: DOMAIN }
);
+865 -614
View File
File diff suppressed because it is too large Load Diff