Update:Author names ignore periods when checking for existing authors #993

This commit is contained in:
advplyr 2022-09-18 16:58:20 -05:00
parent ae4ac392c6
commit be592a04d0
2 changed files with 11 additions and 1 deletions

View file

@ -91,4 +91,13 @@ module.exports.parse = (nameString) => {
nameLF: lastFirst, // String of comma separated last, first
names: namesArray // Array of first last
}
}
module.exports.checkNamesAreEqual = (name1, name2) => {
if (!name1 || !name2) return false
// e.g. John H. Smith will be equal to John H Smith
name1 = String(name1).toLowerCase().trim().replace(/\./g, '')
name2 = String(name2).toLowerCase().trim().replace(/\./g, '')
return name1 === name2
}