in src/manifestList.ts [396:422]
private validateManifest(path: string): boolean {
function isEmpty(obj: Record<string, any>): boolean {
return Object.entries(obj).length === 0;
}
try {
const doc = fs.readFileSync(path, { encoding: 'utf8' });
const contents = yaml.safeLoad(doc, { json: true });
if (contents === undefined) {
return false;
}
if (
'project' in contents &&
'packages' in contents.project &&
!isEmpty(contents.project.packages)
) {
return true;
}
if ('packages' in contents && !isEmpty(contents.packages)) {
return true;
}
} catch {
// ignore exception
}
return false;
}