isStored → isNotHostedImage#2385
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…nto is-not-hosted-image
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR renames and refactors the image hosting check by replacing the isStored function with a new isNotHostedImage function throughout the codebase.
- Introduced isNotHostedImage in storage.ts using a simplified URL check
- Updated image handling in update, create, and bulk updating of links to use isNotHostedImage
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/web/lib/storage.ts | Added new function isNotHostedImage with a simplified hosted image check |
| apps/web/lib/api/links/update-link.ts | Updated image proxy condition to use isNotHostedImage |
| apps/web/lib/api/links/create-link.ts | Replaced isStored with isNotHostedImage in image handling logic |
| apps/web/lib/api/links/bulk-update-links.ts | Replaced isStored with isNotHostedImage in image proxy evaluation |
Comments suppressed due to low confidence (5)
apps/web/lib/api/links/create-link.ts:202
- Ensure that the new check with isNotHostedImage properly differentiates between images that require upload and those that are already hosted.
proxy && image && isNotHostedImage(image) ? uploadedImageUrl : response.image,
apps/web/lib/storage.ts:157
- The new isNotHostedImage function uses a simplified check (only verifying if the URL starts with 'https://') compared to the previous isStored logic. Please ensure this change covers all cases for hosted image URLs as intended.
export const isNotHostedImage = (imageString: string) => {
apps/web/lib/api/links/update-link.ts:96
- Confirm that replacing '!isStored(image)' with 'isNotHostedImage(image)' correctly reflects the intended logic for proxy image handling in this update.
proxy && image && isNotHostedImage(image)
apps/web/lib/api/links/create-link.ts:63
- Verify that using isNotHostedImage here yields the expected behavior, ensuring that only non-hosted images are processed for upload.
image: proxy && image && isNotHostedImage(image) ? null : image,
apps/web/lib/api/links/bulk-update-links.ts:53
- Double-check that the updated image validation using isNotHostedImage consistently implements the intended proxy logic during bulk updates.
proxy && image && isNotHostedImage(image)
devkiran
approved these changes
May 2, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.