UNPKG

module-replacements

Version:

This package provides a set of manifests which each define a mapping of JS modules to their suggested replacements.

17 lines (16 loc) 452 B
export function resolveDocUrl(url) { if (!url) return null; if (typeof url === 'string') return url; switch (url.type) { case 'mdn': return `https://developer.mozilla.org/en-US/docs/${url.id}`; case 'node': return `https://nodejs.org/${url.id}`; case 'e18e': return `https://e18e.dev/docs/replacements/${url.id}`; default: return null; } }