export const testDocument = (doc) =>
  doc.fileExtname === '.md' && 
  doc.fileStem.match(/^[A-Z]+/) && 
  !doc.fileStem.match(/spec/) &&
  !doc.fileStem.match(/README|LICENSE|CONTRIBUTING/i)

export const decorate = (doc) =>
  Object.assign(doc, {
    toProjectConfiguration() {
      const exportable = doc.createExportable()

      return Object.assign({}, 
        doc.pick('id', 'cacheKey', 'idParts', 'baseRelativePath'), 
        exportable.frontmatter, 
        exportable
      )
    }    
  })