Refactor all .length === 0 patterns in JS (#30045)

This pattern comes of often during review, so let's fix it once and for
all. Did not test, but changes are trivial enough imho.
This commit is contained in:
silverwind 2024-03-25 19:37:55 +01:00 committed by GitHub
parent f73d891fc4
commit 8fe26fb314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 31 additions and 40 deletions

View file

@ -34,7 +34,7 @@ export function initCompSearchUserBox() {
}
});
if (allowEmailInput && items.length === 0 && looksLikeEmailAddressCheck.test(searchQuery)) {
if (allowEmailInput && !items.length && looksLikeEmailAddressCheck.test(searchQuery)) {
const resultItem = {
title: searchQuery,
description: allowEmailDescription,