Refactored Arch Angel, split off The Flourish. Added try URL util to simplify trying multiple actor URLs.

This commit is contained in:
DebaucheryLibrarian
2026-01-11 00:50:16 +01:00
parent 6cb990dbdb
commit 6338e8fb8d
10 changed files with 332 additions and 225 deletions

20
src/utils/try-urls.js Normal file
View File

@@ -0,0 +1,20 @@
const unprint = require('unprint');
async function tryUrls(urls, options) {
return urls.filter(Boolean).reduce(async (chain, url) => {
const acc = await chain;
if (acc?.res.ok) {
return acc;
}
const res = await unprint.get(url, options);
return {
res,
url,
};
}, Promise.resolve());
}
module.exports = tryUrls;