thrownewError(`Could not find license for ${dependencyName}`);
}
licenseBody=`License: ${license}`;
}
}
return[
`## ${dependencyName}`,
'',
...licenseBody.split(/\r?\n/).map(line=>{
consttrimmed=line.trim();
if(trimmed){
return`${trimmed}`;
}
returntrimmed;
}),
].join('\n');
}
asyncfunctionmain(){
assert.deepStrictEqual(
Object.keys(optionalDependencies),
['fs-xattr'],
'Unexpected optionalDependencies when generating acknowledgments file. To ensure that this file is generated deterministically, make sure to special-case it the acknowledgments generation script.'
);
constdependencyNames=[
...Object.keys(dependencies),
...Object.keys(optionalDependencies),
]
.filter(name=>!SKIPPED_DEPENDENCIES.has(name))
.sort();
constmarkdownsForDependency=awaitpMap(
dependencyNames,
getMarkdownForDependency,
// Without this, we may run into "too many open files" errors.