isNonEmptyArray => arrayLength

This commit is contained in:
djmaze 2021-07-21 21:34:17 +02:00
parent 1e49c1a6ac
commit 5590fd4860
20 changed files with 68 additions and 74 deletions

4
dev/External/ko.js vendored
View file

@ -1,7 +1,7 @@
import { i18nToNodes } from 'Common/Translator';
import { doc, createElement } from 'Common/Globals';
import { SaveSettingsStep } from 'Common/Enums';
import { isNonEmptyArray, isFunction } from 'Common/Utils';
import { arrayLength, isFunction } from 'Common/Utils';
const
koValue = value => !ko.isObservable(value) && isFunction(value) ? value() : ko.unwrap(value);
@ -136,7 +136,7 @@ ko.extenders.limitedList = (target, limitedList) => {
const currentValue = ko.unwrap(target),
list = ko.unwrap(limitedList);
if (isNonEmptyArray(list)) {
if (arrayLength(list)) {
if (list.includes(newValue)) {
target(newValue);
} else if (list.includes(currentValue, list)) {