Files
lan-manager/web/node_modules/@antv/util/lib/remove.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

30 lines
829 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_like_1 = require("./is-array-like");
var pull_at_1 = require("./pull-at");
var remove = function (arr, predicate) {
/**
* const arr = [1, 2, 3, 4]
* const evens = remove(arr, n => n % 2 == 0)
* console.log(arr) // => [1, 3]
* console.log(evens) // => [2, 4]
*/
var result = [];
if (!is_array_like_1.default(arr)) {
return result;
}
var i = -1;
var indexes = [];
var length = arr.length;
while (++i < length) {
var value = arr[i];
if (predicate(value, i, arr)) {
result.push(value);
indexes.push(i);
}
}
pull_at_1.default(arr, indexes);
return result;
};
exports.default = remove;
//# sourceMappingURL=remove.js.map