Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
1 year ago
|
/**
|
||
|
* Code refactored from Mozilla Developer Network:
|
||
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
||
|
*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
function assign(target, firstSource) {
|
||
|
if (target === undefined || target === null) {
|
||
|
throw new TypeError('Cannot convert first argument to object');
|
||
|
}
|
||
|
|
||
|
var to = Object(target);
|
||
|
for (var i = 1; i < arguments.length; i++) {
|
||
|
var nextSource = arguments[i];
|
||
|
if (nextSource === undefined || nextSource === null) {
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
var keysArray = Object.keys(Object(nextSource));
|
||
|
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
||
|
var nextKey = keysArray[nextIndex];
|
||
|
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
||
|
if (desc !== undefined && desc.enumerable) {
|
||
|
to[nextKey] = nextSource[nextKey];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return to;
|
||
|
}
|
||
|
|
||
|
function polyfill() {
|
||
|
if (!Object.assign) {
|
||
|
Object.defineProperty(Object, 'assign', {
|
||
|
enumerable: false,
|
||
|
configurable: true,
|
||
|
writable: true,
|
||
|
value: assign
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
assign: assign,
|
||
|
polyfill: polyfill
|
||
|
};
|