var toString = Object.prototype.toString,
    hasOwn = Object.prototype.hasOwnProperty,
    push = Array.prototype.push,
    slice = Array.prototype.slice,
    trim = String.prototype.trim,
    indexOf = Array.prototype.indexOf,

    // [[Class]] -> type pairs
    class2type = {};

// Populate the class2type map
"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(name) {
    class2type[ "[object " + name + "]" ] = name.toLowerCase();
});

function type(obj){
    return obj == null ?
            String( obj ) :
            class2type[ toString.call(obj) ] || "object";
}

function isPlainObject( obj ) {
    if ( !obj || type(obj) !== "object") {
        return false;
    }

    // Not own constructor property must be Object
    if ( obj.constructor &&
        !hasOwn.call(obj, "constructor") &&
        !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
        return false;
    }

    // Own properties are enumerated firstly, so to speed up,
    // if last one is own, then all properties are own.

    var key;
    for ( key in obj ) {}

    return key === undefined || hasOwn.call( obj, key );
}

module.exports = function extend(){
    var options, name, src, copy, copyIsArray, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
        deep = false;

    // Handle a deep copy situation
    if ( typeof target === "boolean" ) {
        deep = target;
        target = arguments[1] || {};
        // skip the boolean and the target
        i = 2;
    }

    // Handle case when target is a string or something (possible in deep copy)
    if ( typeof target !== "object" && type(target) !== "function") {
        target = {};
    }

    // extend jQuery itself if only one argument is passed
    if ( length === i ) {
        target = this;
        --i;
    }

    for ( ; i < length; i++ ) {
        // Only deal with non-null/undefined values
        if ( (options = arguments[ i ]) != null ) {
            // Extend the base object
            for ( name in options ) {
                src = target[ name ];
                copy = options[ name ];

                // Prevent never-ending loop
                if ( target === copy ) {
                    continue;
                }

                // Recurse if we're merging plain objects or arrays
                if ( deep && copy && ( isPlainObject(copy) || (copyIsArray = type(copy) === "array") ) ) {
                    if ( copyIsArray ) {
                        copyIsArray = false;
                        clone = src && type(src) === "array" ? src : [];

                    } else {
                        clone = src && isPlainObject(src) ? src : {};
                    }

                    // Never move original objects, clone them
                    target[ name ] = extend( deep, clone, copy );

                // Don't bring in undefined values
                } else if ( copy !== undefined ) {
                    target[ name ] = copy;
                }
            }
        }
    }

    // Return the modified object
    return target;
};
@@ -1,12 +1,53 @@
+module.exports = function extend()%7B%0A%0A    
 var toString
@@ -76,16 +76,20 @@
 String,%0A
+    
     hasO
@@ -126,16 +126,20 @@
 operty,%0A
+    
     push
@@ -167,16 +167,20 @@
 sh,%0A    
+  
+  
 slice = 
@@ -206,16 +206,20 @@
 ce,%0A    
+  
+  
 trim = S
@@ -244,16 +244,20 @@
 im,%0A    
+ 
+   
 indexOf 
@@ -288,16 +288,20 @@
 f,%0A%0A    
+   
+ 
 // %5B%5BCla
@@ -319,16 +319,20 @@
 e pairs%0A
+    
     clas
@@ -345,16 +345,20 @@
  = %7B%7D;%0A%0A
+    
 // Popul
@@ -380,16 +380,20 @@
 ype map%0A
+    
 %22Boolean
@@ -474,24 +474,28 @@
 ion(name) %7B%0A
+    
     class2ty
@@ -550,13 +550,21 @@
 ();%0A
+    
 %7D);%0A%0A
+    
 func
@@ -579,24 +579,28 @@
 e(obj)%7B%0A    
+ 
+   
 return obj =
@@ -620,16 +620,20 @@
         
+   
+ 
 String( 
@@ -640,16 +640,20 @@
 obj ) :%0A
+    
         
@@ -702,19 +702,27 @@
 bject%22;%0A
-%7D%0A%0A
+    %7D%0A%0A    
 function
@@ -741,24 +741,28 @@
 ct( obj ) %7B%0A
+    
     if ( !ob
@@ -792,32 +792,36 @@
 ect%22) %7B%0A        
+  
+  
 return false;%0A  
@@ -818,27 +818,35 @@
  false;%0A    
-%7D%0A%0A
+    %7D%0A%0A    
     // Not o
@@ -884,24 +884,28 @@
  Object%0A    
+   
+ 
 if ( obj.con
@@ -912,24 +912,28 @@
 structor &&%0A
+    
         !has
@@ -964,32 +964,36 @@
 or%22) &&%0A        
+  
+  
 !hasOwn.call(obj
@@ -1033,24 +1033,28 @@
 ypeOf%22) ) %7B%0A
+    
         retu
@@ -1063,27 +1063,35 @@
  false;%0A    
-%7D%0A%0A
+    %7D%0A%0A    
     // Own p
@@ -1140,16 +1140,20 @@
 eed up,%0A
+    
     // i
@@ -1201,16 +1201,20 @@
 e own.%0A%0A
+    
     var 
@@ -1218,16 +1218,20 @@
 ar key;%0A
+    
     for 
@@ -1249,16 +1249,20 @@
 j ) %7B%7D%0A%0A
+    
     retu
@@ -1314,46 +1314,14 @@
  );%0A
-%7D%0A%0Amodule.exports = function extend()%7B
+    %7D%0A
 %0A   

refactor extend to work without globals