/** 是否可作為 next/image 或 img 的 src */
export function hasValidImageSrc(src: string | null | undefined): src is string {
    return Boolean(String(src ?? '').trim())
}

/** Lottie animationData 最低限度結構檢查，避免 lottie-react 拋錯 */
export function isLottieAnimationData(value: unknown): value is object {
    if (!value || typeof value !== 'object' || Array.isArray(value)) return false
    const row = value as Record<string, unknown>
    return typeof row.v === 'string' || Array.isArray(row.layers)
}
