MCPcopy Create free account
hub / github.com/amrkmn/x / parseSourceUrl

Function parseSourceUrl

scripts/extensions.ts:193–200  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

191 const apkUrl = resources.apkUrl ?? '';
192 const source = (raw.sources as Array<{ language?: string }> | undefined)?.[0];
193 const warning = (raw.contentWarning ?? '') as string;
194
195 return {
196 pkg: String(raw.packageName),
197 name: String(raw.name),
198 version: String(raw.versionName ?? ''),
199 lang: source?.language ?? '',
200 apk: apkUrl.split('/').pop() ?? '',
201 ...(resources.iconUrl ? { iconUrl: resources.iconUrl } : {}),
202 nsfw: warning === 'CONTENT_WARNING_NSFW' || warning === 'CONTENT_WARNING_MIXED' ? 1 : 0,
203 code: raw.versionCode !== undefined ? Number(raw.versionCode) : undefined

Callers 2

getRemoteHeadFunction · 0.85
cloneRepositoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected