lib/options/urls.js
async function parseUrlsOption (state, urls) {
  if (!urls || urls.length === 0) {
    // get URLs for all sections across all pages
    const pages = await getDocPages(state)
    return (await pages.reduce(toSectionUrls.bind(null, state), [])).map(normalizeUrl)
  }

  const normalizedUrls = urls.map(normalizeUrl)
  const invalidUrls = normalizedUrls.filter(isntV3DocumentationUrl)
  if (invalidUrls.length) {
    throw new Error(`Invalid URLs: ${invalidUrls.join(', ')}`)
  }

  const pageUrls = normalizedUrls.filter(isPageUrl)

  const sectionUrls = normalizedUrls.filter(isSectionUrl)
  return _.uniq((await pageUrls.reduce(toSectionUrls.bind(null, state), [])).concat(sectionUrls))
}
async function parseUrlsOption (state, urls) {
  if (!urls || urls.length === 0) {
    // get URLs for all sections across all pages
    const pages = await getDocPages(state)
    return (await pages.reduce(toSectionUrls.bind(null, state), [])).map(normalizeUrl)
  }

  const normalizedUrls = urls.map(normalizeUrl)
  const invalidUrls = normalizedUrls.filter(isntV3DocumentationUrl)
  if (invalidUrls.length) {
    throw new Error(`Invalid URLs: ${invalidUrls.join(', ')}`)
  }

  const pageUrls = normalizedUrls.filter(isPageUrl)

  const sectionUrls = normalizedUrls.filter(isSectionUrl)
  return _.uniq((await pageUrls.reduce(toSectionUrls.bind(null, state), [])).concat(sectionUrls))
}
async function parseUrlsOption ( state , urls ) { if ( ! urls || urls . length === 0 ) { // get URLs for all sections across all pages const pages = await getDocPages ( state ) return ( await pages . reduce ( toSectionUrls . bind ( null , state ) , [ ] ) ) . map ( normalizeUrl ) } const normalizedUrls = urls . map ( normalizeUrl ) const invalidUrls = normalizedUrls . filter ( isntV3DocumentationUrl ) if ( invalidUrls . length ) { throw new Error ( ` ${ invalidUrls . join ( ', ' ) } ` ) } const pageUrls = normalizedUrls . filter ( isPageUrl ) const sectionUrls = normalizedUrls . filter ( isSectionUrl ) return _ . uniq ( ( await pageUrls . reduce ( toSectionUrls . bind ( null , state ) , [ ] ) ) . concat ( sectionUrls ) ) }
returns all section URLs from all documentation pages by default
If URLs are passed than the page URLs are turned into their section URLs
returns all section URLs from all documentation pages by default If URLs are passed than the page URLs are turned into their section URLs