/usr/lib/nodejs/arr-diff/index.js is in node-arr-diff 3.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | /*!
* arr-diff <https://github.com/jonschlinkert/arr-diff>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License
*/
'use strict';
var flatten = require('arr-flatten');
var slice = [].slice;
module.exports = function(arr, arrays) {
arrays = flatten(slice.call(arguments, 1));
var len = arrays.length;
for (var i = 0; i < len; i++) {
remove(arr, arrays[i]);
}
return arr;
};
function remove(arr, ele) {
var idx = arr.indexOf(ele);
while (idx !== -1) {
arr.splice(idx, 1);
idx = arr.indexOf(ele);
}
}
|