Skip to content

Commit 5345452

Browse files
committed
Do not use conditional chaining
1 parent b9ff3ef commit 5345452

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

helper/labelGenerator.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ module.exports = function( record, req ){
1414
// in virtually all cases, this will be the `name` field
1515
var labelParts = getInitialLabel(record);
1616
// do not add neighbourhood to largish area-like items
17-
const skip = record.category?.includes('populated area') ? 'neighbourhood' : null;
17+
const categ = record.category || [];
18+
const skip = categ.includes('populated area') ? 'neighbourhood' : null;
1819
// iterate the schema
1920
for (var field in schema) {
2021
var valueFunction = schema[field];

0 commit comments

Comments
 (0)