MCPcopy
hub / github.com/npmx-dev/npmx.dev / normalizeLicense

Function normalizeLicense

shared/utils/npm.ts:74–79  ·  view source on GitHub ↗
(license?: PackumentLicense)

Source from the content-addressed store, hash-verified

72 * @returns License string, or `undefined` if not present or unrecognized
73 */
74export function normalizeLicense(license?: PackumentLicense): string | undefined {
75 if (!license) return undefined
76 if (typeof license === 'string') return license
77 if (typeof license.type === 'string') return license.type
78 return undefined
79}

Callers 7

npm.spec.tsFile · 0.90
fetchPackagesFunction · 0.90
transformPackumentFunction · 0.90
[...pkg].get.tsFile · 0.90
[...pkg].get.tsFile · 0.90
[...pkg].get.tsFile · 0.90
[...pkg].get.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected