mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
replaced ko.utils.array* with native
This commit is contained in:
parent
20b1e08c9b
commit
d49916731f
14 changed files with 137 additions and 230 deletions
20
vendors/knockout/src/utils.js
vendored
20
vendors/knockout/src/utils.js
vendored
|
|
@ -25,17 +25,8 @@ ko.utils = (() => {
|
|||
var canSetPrototype = ({ __proto__: [] } instanceof Array);
|
||||
|
||||
return {
|
||||
arrayForEach: (array, action, actionOwner) =>
|
||||
arrayCall('forEach', array, action, actionOwner),
|
||||
|
||||
arrayIndexOf: (array, item) =>
|
||||
arrayCall('indexOf', array, item),
|
||||
|
||||
arrayFirst: (array, predicate, predicateOwner) =>
|
||||
arrayCall('find', array, (e, i, a) => predicate.call(predicateOwner, e, i, a)),
|
||||
|
||||
arrayRemoveItem: (array, itemToRemove) => {
|
||||
var index = ko.utils.arrayIndexOf(array, itemToRemove);
|
||||
var index = array.indexOf(itemToRemove);
|
||||
if (index > 0) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
|
|
@ -44,15 +35,6 @@ ko.utils = (() => {
|
|||
}
|
||||
},
|
||||
|
||||
arrayPushAll: (array, valuesToPush) => {
|
||||
if (valuesToPush instanceof Array)
|
||||
array.push.apply(array, valuesToPush);
|
||||
else
|
||||
for (var i = 0, j = valuesToPush.length; i < j; i++)
|
||||
array.push(valuesToPush[i]);
|
||||
return array;
|
||||
},
|
||||
|
||||
canSetPrototype: canSetPrototype,
|
||||
|
||||
extend: extend,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue