Change .find() predicate to not reject field names based on spurious whitespace.

This commit is contained in:
Eamonn Bell 2017-06-22 21:49:31 +01:00
parent 3e105b3089
commit e51071abf4

View File

@ -30,7 +30,7 @@ const slugFormatter = (template = "{{slug}}", entryData) => {
const getIdentifier = (entryData) => {
const validIdentifierFields = ["title", "path"];
const identifiers = validIdentifierFields.map((field) =>
entryData.find((_, key) => key.toLowerCase() === field)
entryData.find((_, key) => key.toLowerCase().trim() === field)
);
const identifier = identifiers.find(ident => ident !== undefined);