mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-02 09:54:21 +08:00
KnockoutJS use Array.isArray
This commit is contained in:
parent
a40e6484a1
commit
ee3aa16fcf
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ ko.bindingHandlers['options'] = {
|
|||
}
|
||||
|
||||
if (unwrappedArray) {
|
||||
if (typeof unwrappedArray.length == "undefined") // Coerce single value into array
|
||||
if (!Array.isArray(unwrappedArray)) // Coerce single value into array
|
||||
unwrappedArray = [unwrappedArray];
|
||||
|
||||
// Filter out any entries marked as destroyed
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
ko.utils.setDomNodeChildrenFromArrayMapping = (domNode, array, mapping, options, callbackAfterAddingNodes, editScript) => {
|
||||
array = array || [];
|
||||
if (typeof array.length == "undefined") // Coerce single value into array
|
||||
if (!Array.isArray(array)) // Coerce single value into array
|
||||
array = [array];
|
||||
|
||||
options = options || {};
|
||||
|
|
Loading…
Add table
Reference in a new issue