django-vue3-admin-web/node_modules/@interactjs/utils/arr.js
2025-10-20 21:21:14 +08:00

29 lines
789 B
JavaScript

/**
* interact.js 1.10.27
*
* Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>
* Released under the MIT License.
* https://raw.github.com/taye/interact.js/main/LICENSE
*/
const contains = (array, target) => array.indexOf(target) !== -1;
const remove = (array, target) => array.splice(array.indexOf(target), 1);
const merge = (target, source) => {
for (const item of source) {
target.push(item);
}
return target;
};
const from = source => merge([], source);
const findIndex = (array, func) => {
for (let i = 0; i < array.length; i++) {
if (func(array[i], i, array)) {
return i;
}
}
return -1;
};
const find = (array, func) => array[findIndex(array, func)];
export { contains, find, findIndex, from, merge, remove };
//# sourceMappingURL=arr.js.map