/usr/lib/nodejs/extend-shallow/index.js is in node-extend-shallow 3.0.1-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 29 30 31 32 33 34 35 36 | 'use strict';
var isExtendable = require('is-extendable');
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
throw new TypeError('expected an object');
}
for (var i = 1; i < arguments.length; i++) {
var val = arguments[i];
if (isObject(val)) {
assign(obj, val);
}
}
return obj;
};
function assign(a, b) {
for (var key in b) {
if (hasOwn(b, key)) {
a[key] = b[key];
}
}
}
function isObject(val) {
return (val && typeof val === 'object') || isExtendable(val);
}
/**
* Returns true if the given `key` is an own property of `obj`.
*/
function hasOwn(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
|