Skip to content

Commit

Permalink
Fix 'duplicate types' check for properties with a single type (#1399)
Browse files Browse the repository at this point in the history
Fix 'duplicate types' check for properties with a single type
  • Loading branch information
skjnldsv authored Jan 6, 2020
2 parents 783c7a6 + f8435e9 commit df8c466
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/services/checks/duplicateTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ export default {
try {
const props = contact.vCard.getAllProperties()
.map(prop => prop.getParameter('type'))
.filter(prop => prop)
.filter(prop => Array.isArray(prop))
const fixed = props.map(prop => [...new Set(prop)])
if (props
&& Array.isArray(props)
&& props.length > 0
&& props.join('') !== fixed.join('')) {
if (props.join('') !== fixed.join('')) {
return true
}
} catch (error) {
Expand Down

0 comments on commit df8c466

Please sign in to comment.