대표 이미지 원본 선택 보강 v1.7.9
This commit is contained in:
10
lib/post-card-thumbnail-url.js
Normal file
10
lib/post-card-thumbnail-url.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const postCardThumbnailUrlPattern = /^\/uploads\/posts\/\d{4}\/\d{2}\/thumbs\/[^/?#]+-card\.webp$/i
|
||||
|
||||
/**
|
||||
* 게시물 카드 썸네일 URL인지 확인한다.
|
||||
* @param {string|null|undefined} imageUrl - 검사할 이미지 URL
|
||||
* @returns {boolean} 카드 썸네일 여부
|
||||
*/
|
||||
export const isPostCardThumbnailUrl = (imageUrl) => Boolean(
|
||||
imageUrl && postCardThumbnailUrlPattern.test(String(imageUrl))
|
||||
)
|
||||
Reference in New Issue
Block a user