Skip to content

Commit

Permalink
Do not use conditional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed Dec 28, 2023
1 parent b9ff3ef commit 5345452
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper/labelGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = function( record, req ){
// in virtually all cases, this will be the `name` field
var labelParts = getInitialLabel(record);
// do not add neighbourhood to largish area-like items
const skip = record.category?.includes('populated area') ? 'neighbourhood' : null;
const categ = record.category || [];
const skip = categ.includes('populated area') ? 'neighbourhood' : null;
// iterate the schema
for (var field in schema) {
var valueFunction = schema[field];
Expand Down

0 comments on commit 5345452

Please sign in to comment.