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

Function convertSkypackImportMapToLockfile

snowpack/src/util.ts:147–159  ·  view source on GitHub ↗
(
  dependencies: Record<string, string>,
  importMap: ImportMap,
)

Source from the content-addressed store, hash-verified

145}
146
147export function convertSkypackImportMapToLockfile(
148 dependencies: Record<string, string>,
149 importMap: ImportMap,
150): LockfileManifest {
151 const result = {dependencies, lock: {}};
152 for (const [key, val] of Object.entries(dependencies)) {
153 if (importMap.imports[key]) {
154 const valPath = url.parse(importMap.imports[key]).pathname;
155 result.lock[key + '#' + val] = valPath?.substr(1);
156 }
157 }
158 return result;
159}
160
161export async function writeLockfile(loc: string, importMap: LockfileManifest): Promise<void> {
162 importMap.dependencies = sortObject(importMap.dependencies);

Callers 2

addCommandFunction · 0.90
rmCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected