All files / scripts fetchProjects.js

70% Statements 7/10
44.44% Branches 4/9
0% Functions 0/1
70% Lines 7/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  4x 4x   4x                 4x 4x                   4x 4x      
#!/usr/bin/env node
const parseReadme = require('./lib/parseReadme');
const { fetchPinned } = require('./lib/fetchPinned');
 
Iif (require.main === module) {
  fetchPinned().catch(e => {
    console.error('Unhandled error in fetchPinned:', (e && e.message) || e);
    process.exit(4);
  });
}
 
// Dual-use: CLI entry point when run directly, and a re-export surface for other
// scripts (e.g. applyFallbackDocScan.js) that need parseReadme utilities.
Eif (typeof module !== 'undefined' && module.exports) {
  module.exports = {
    parseMarkdown: parseReadme.parseMarkdown,
    extractSectionWithRegex: parseReadme.extractSectionWithRegex,
    normalizeTitle: parseReadme.normalizeTitle,
    normalizeSummary: parseReadme.normalizeSummary,
    findImageCandidateFromAst: parseReadme.findImageCandidateFromAst,
    isBadgeLike: parseReadme.isBadgeLike,
    extractTechnologiesFromAst: parseReadme.extractTechnologiesFromAst,
    extractDocsFromAst: parseReadme.extractDocsFromAst
  };
  try {
    module.exports.extractRepoDocsDetailed = require('./lib/docs').extractRepoDocsDetailed;
  } catch (e) { /* not available in all environments */ }
}