UNPKG

@atproto/api

Version:

Client library for atproto and Bluesky

17 lines 567 B
import { ModerationDecision } from '../decision.js'; export function decideProfile(subject, opts) { const acc = new ModerationDecision(); acc.setDid(subject.did); acc.setIsMe(subject.did === opts.userDid); for (const label of filterProfileLabels(subject.labels)) { acc.addLabel('profile', label, opts); } return acc; } export function filterProfileLabels(labels) { if (!labels) { return []; } return labels.filter((label) => label.uri.endsWith('/app.bsky.actor.profile/self')); } //# sourceMappingURL=profile.js.map