import { PUBLIC_IPFS_PATH } from '../config/index.js'; import { logger as parentLogger } from '../logger.js'; export const cleanupManifestUrl = (url: string, gateway?: string) => { if (url && (PUBLIC_IPFS_PATH || gateway)) { const s = url.split('/'); const res = `${gateway ? gateway : PUBLIC_IPFS_PATH}/${s[s.length - 1]}`; parentLogger.info({ fn: 'cleanupManifestUrl', url, gateway }, `resolving ${url} => ${res}`); return res; } return url; };