src/components/PaginateLinks.js
function getLimitedLinksMetadata (limitedLinks) {
  return limitedLinks.map((link, index) => {
    if (link === ELLIPSES && limitedLinks[index - 1] === 0) {
      return 'left-ellipses'
    } else if (link === ELLIPSES && limitedLinks[index - 1] !== 0) {
      return 'right-ellipses'
    }
    return link
  })
}
function getLimitedLinksMetadata (limitedLinks) {
  return limitedLinks.map((link, index) => {
    if (link === ELLIPSES && limitedLinks[index - 1] === 0) {
      return 'left-ellipses'
    } else if (link === ELLIPSES && limitedLinks[index - 1] !== 0) {
      return 'right-ellipses'
    }
    return link
  })
}
function getLimitedLinksMetadata ( limitedLinks ) { return limitedLinks . map ( ( link , index ) => { if ( link === ELLIPSES && limitedLinks [ index - 1 ] === 0 ) { return 'left-ellipses' } else if ( link === ELLIPSES && limitedLinks [ index - 1 ] !== 0 ) { return 'right-ellipses' } return link } ) }
Mainly used here to check whether the displayed
ellipses is for showing previous or next links
Mainly used here to check whether the displayed ellipses is for showing previous or next links