MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getPublishedImportUrl

Function getPublishedImportUrl

site/demo.ts:74–88  ·  view source on GitHub ↗
(
  specifier: string,
  version: string,
  peerDependencies: {[dependency: string]: string},
)

Source from the content-addressed store, hash-verified

72};
73
74export const getPublishedImportUrl = (
75 specifier: string,
76 version: string,
77 peerDependencies: {[dependency: string]: string},
78): string | undefined => {
79 const [mainModule, ...subModules] = specifier.split('/');
80 const dependencyVersion =
81 mainModule == 'tinybase' ? version : peerDependencies[mainModule];
82 if (dependencyVersion == null) {
83 return;
84 }
85 return `https://esm.sh/${mainModule}@${dependencyVersion}${
86 subModules.length == 0 ? '' : '/' + subModules.join('/')
87 }`;
88};
89
90const getEntryFileName = (files: {[path: string]: string}): string =>
91 ['src/main.js', 'src/main.jsx', 'index.js', 'index.jsx'].find(

Callers 1

buildFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…