Files
railwaysystem/RuoYi-Vue/ruoyi-ui/node_modules2/@antv/util/src/pull.ts
T

16 lines
415 B
TypeScript
Raw Normal View History

2026-09-10 15:40:10 +08:00
const arrPrototype = Array.prototype;
const splice = arrPrototype.splice;
const indexOf = arrPrototype.indexOf;
const pull = function<T>(arr: T[], ...values: any[]): T[] {
for (let i = 0; i < values.length; i++) {
const value = values[i];
let fromIndex = -1;
while ((fromIndex = indexOf.call(arr, value)) > -1) {
splice.call(arr, fromIndex, 1);
}
}
return arr;
};
export default pull;