ElectronicBabylonianLiterature/ebl-frontend

View on GitHub
src/test-support/createAuthorRexExp.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import _ from 'lodash'
import BibliographyEntry from 'bibliography/domain/BibliographyEntry'

export default function createAuthorRegExp(entry: BibliographyEntry): RegExp {
  return new RegExp(_.escapeRegExp(entry.primaryAuthor.replace(/'/g, '’')))
}