Change .find() predicate to not reject field names based on spurious whitespace.
This commit is contained in:
parent
3e105b3089
commit
e51071abf4
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user