MCPcopy
hub / github.com/FredKSchott/snowpack / convertLockfileToSkypackImportMap

Function convertLockfileToSkypackImportMap

snowpack/src/util.ts:135–145  ·  view source on GitHub ↗
(
  origin: string,
  lockfile: LockfileManifest,
)

Source from the content-addressed store, hash-verified

133}
134
135export function convertLockfileToSkypackImportMap(
136 origin: string,
137 lockfile: LockfileManifest,
138): ImportMap {
139 const result = {imports: {}};
140 for (const [key, val] of Object.entries(lockfile.lock)) {
141 result.imports[key.replace(/\#.*/, '')] = origin + '/' + val;
142 result.imports[key.replace(/\#.*/, '') + '/'] = origin + '/' + val + '/';
143 }
144 return result;
145}
146
147export function convertSkypackImportMapToLockfile(
148 dependencies: Record<string, string>,

Callers 3

addCommandFunction · 0.90
rmCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected