Array.isArray to isArray

Array.isNotEmpty to isNonEmptyArray
This commit is contained in:
djmaze 2021-03-16 16:49:14 +01:00
parent 986b8f056b
commit 0b64083543
30 changed files with 82 additions and 69 deletions

View file

@ -3,6 +3,7 @@ import ko from 'ko';
import { HtmlEditor } from 'Common/Html';
import { timeToNode } from 'Common/Momentor';
import { elementById } from 'Common/Globals';
import { isArray } from 'Common/Utils';
import { EmailAddressesComponent } from 'Component/EmailAddresses';
import { ThemeStore } from 'Stores/Theme';
@ -144,7 +145,7 @@ ko.bindingHandlers.dropmessages = {
fnStop(e);
if ('messages' === getDragAction(e) && ['move','copy'].includes(e.dataTransfer.effectAllowed)) {
let data = dragData.data;
if (folder && data && data.folder && Array.isArray(data.uids)) {
if (folder && data && data.folder && isArray(data.uids)) {
rl.app.moveMessagesToFolder(data.folder, data.uids, folder.fullNameRaw, data.copy && e.ctrlKey);
}
}

3
dev/External/ko.js vendored
View file

@ -1,6 +1,7 @@
import { i18n, i18nToNodes, trigger } from 'Common/Translator';
import { doc, createElement } from 'Common/Globals';
import { SaveSettingsStep } from 'Common/Enums';
import { isNonEmptyArray } from 'Common/Utils';
const
isFunction = v => typeof v === 'function',
@ -146,7 +147,7 @@ ko.extenders.limitedList = (target, limitedList) => {
const currentValue = ko.unwrap(target),
list = ko.unwrap(limitedList);
if (Array.isNotEmpty(list)) {
if (isNonEmptyArray(list)) {
if (list.includes(newValue)) {
target(newValue);
} else if (list.includes(currentValue, list)) {