mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
KnockoutJS use more Array.isArray
This commit is contained in:
parent
1357a696be
commit
b07bf3ad12
2 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
ko['observableArray'] = initialValues => {
|
||||
initialValues = initialValues || [];
|
||||
|
||||
if (typeof initialValues != 'object' || !('length' in initialValues))
|
||||
if (!Array.isArray(initialValues))
|
||||
throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
|
||||
|
||||
return Object.setPrototypeOf(ko.observable(initialValues), ko['observableArray']['fn']).extend({'trackArrayChanges':true});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue