function isMemberVisibleTo
isMemberVisibleTo(
playlist: Pick<Playlist, "userId">,
viewerId: string | null | undefined
): boolean

Checks whether viewerId may see member in playlist. A public dump is visible to all. A private dump is visible only to the playlist's owner, and only if they posted it: moderators don't see it, and neither does the owner once someone else's dump in their playlist goes private. A null or undefined viewerId is a signed-out viewer.

Parameters

playlist: Pick<Playlist, "userId">
viewerId: string | null | undefined

Return Type

boolean

Usage

import { isMemberVisibleTo } from "api/lib/playlist-members.ts";