实现示例type Item = { name: string; version: string; license?: string; hasLicense: boolean; hasNotice: boolean }
function valid(item: Item): boolean {
if (!item.name || !item.version) return false
if (!item.license) return false
return item.hasLicense && item.hasNotice
}
function evaluate(list: Item[]): { ok: boolean; missing: string[] } {
const missing: string[] = []
for (const i of list) if (!valid(i)) missing.push(`${i.name}@${i.version}`)
return { ok: missing.length === 0, missing }
}
审计与发布治理归档包含依赖、许可证类型与 NOTICE 状态;缺失阻断并补齐后再发布。审计记录支持快速检索与合规审查。

发表评论 取消回复