'use strict';

var assign = Object.assign || require('object.assign');

function hasOwnKey(key, object) {
    return object != null && object.hasOwnProperty(key);
}

function objectsHaveOwnKey() {
    var key = arguments[0],
        objects = [].slice.call(arguments, 1);

    return objects.every(hasOwnKey.bind(null, key));
}

function strictAssign() {
    var target = arguments[0],
        sources = [].slice.call(arguments, 1),
        assignArgs = [].concat({}, sources),
        i,
        key,
        strippedTarget;

    sources.forEach(function stripTarget(source) {
        for (key in source) {
            if (objectsHaveOwnKey(key, source, target)
                && !hasOwnKey(key, strippedTarget)) {
                strippedTarget[key] = target[key];
            }
        }
    });

    assignArgs.push(strippedTarget);
    return assign.apply(null, assignArgs);
}

module.exports = strictAssign;

@@ -335,102 +335,398 @@
 ion 
-strictAssign() %7B%0A    var target = arguments%5B0%5D,%0A        sources = %5B%5D.slice.call(arguments, 1),
+isArray(object) %7B%0A    if (typeof Array.isArray === 'function')%7B%0A        return Array.isArray(object);%0A    %7D%0A    return object.toString() === '%5Bobject Array%5D';%0A%7D%0A%0Afunction strictAssign() %7B%0A    var target = arguments%5B0%5D,%0A        sources = %5B%5D.slice.call(arguments, 1),%0A        assignArgs,%0A        strippedTarget,%0A        i,%0A        key;%0A%0A    if (isArray(target)) %7B%0A        strippedTarget = %5B%5D;
 %0A   
@@ -757,10 +757,10 @@
 cat(
-%7B%7D
+%5B%5D
 , so
@@ -769,57 +769,102 @@
 ces)
-,
+;
 %0A    
-    i,%0A        key,%0A        strippedTarget;
+%7D else %7B%0A        strippedTarget = %7B%7D;%0A        assignArgs = %5B%5D.concat(%7B%7D, sources);%0A    %7D
 %0A%0A  

Add handling for arrays.