Created
December 15, 2024 13:05
-
-
Save YonatanKra/4bae1835df8c88ed63e683db769e995d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#returnPostWithAltlessImages(post: { uri: string; cid: string; value: Record; }) { | |
const images = post.value?.embed?.images || []; | |
const imagesWithoutAlt = images.filter(img => !img.alt); | |
return { post, imagesWithoutAlt }; | |
} | |
async checkSinglePost(postUri: string) { | |
try { | |
const post = await this.#agent.getPost(await parsePostUri(postUri, this.#agent)); | |
return this.#returnPostWithAltlessImages(post); | |
} catch (e) { | |
return e; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment