MCPcopy Index your code
hub / github.com/ginobefun/BestBlogs / fromResourceMeta

Function fromResourceMeta

cli/src/utils/normalize.ts:42–59  ·  view source on GitHub ↗
(meta: ResourceMeta, fallback = false)

Source from the content-addressed store, hash-verified

40}
41
42export function fromResourceMeta(meta: ResourceMeta, fallback = false): NormalizedCandidate {
43 const any = meta as any
44 return {
45 resourceId: meta.resourceId ?? meta.id ?? null,
46 title: meta.title ?? null,
47 readUrl: any.readUrl ?? meta.url ?? null,
48 resourceType: meta.resourceType ?? null,
49 resourceTypeDesc: any.resourceTypeDesc ?? null,
50 language: meta.language ?? null,
51 languageDesc: any.languageDesc ?? null,
52 score: meta.score ?? null,
53 sourceName: meta.sourceName ?? null,
54 candidateSource: meta.candidateSource ?? null,
55 selectionReason: meta.selectionReason ?? meta.recommendReason ?? null,
56 fallbackApplied: fallback || !!meta.fallbackApplied,
57 personalized: !!meta.personalized,
58 }
59}

Callers 4

normalize.test.tsFile · 0.85
registerDiscoverCommandsFunction · 0.85
registerTrendingCommandFunction · 0.85
discoverTodayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected