( dependencies: Record<string, string>, importMap: ImportMap, )
| 145 | } |
| 146 | |
| 147 | export 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 | |
| 161 | export async function writeLockfile(loc: string, importMap: LockfileManifest): Promise<void> { |
| 162 | importMap.dependencies = sortObject(importMap.dependencies); |
no outgoing calls
no test coverage detected