(function (name, definition) {

    // AMD
    if (typeof define === 'function') {
        define(definition);
    }

    // Node.js
    else if (typeof module !== 'undefined' && module.exports) {
        module.exports = definition();
    }

    // Browser
    else {
        window[name] = definition();
    }
})('nullPrune', function () {
  function hasOwnProperty(obj, property) {
    return Object.prototype.hasOwnProperty.call(obj, property)
  }

  function isObject (input) {
    return input && (typeof input === 'object')
  }

  function keys (obj) {
    const ownKeys = []

    for (let key in obj) {
      if (hasOwnProperty(obj, key)) {
        ownKeys.push(key)
      }
    }

    return ownKeys
  }

  function nullPrune (inputObject, { objectKey, parentObject }) {
    keys(inputObject).forEach(function(key) {
      let node = inputObject[key]

      if (isObject(node)) {
        nullPrune(node, {
          objectKey: key,
          parentObject: inputObject
        })
      } else if (node == null) {
        delete inputObject[key]
      }
    })

    if (keys(inputObject).length === 0) {
      delete parentObject[objectKey]
    }
  }

  return function(inputObject) {
    if (!isObject(inputObject)) {
      return inputObject
    }

    nullPrune(inputObject, {})
    return inputObject
  }
})

@@ -28,22 +28,8 @@
 ) %7B%0A
-%0A    // AMD%0A  
   if
@@ -66,20 +66,27 @@
 ) %7B%0A    
- 
+// AMD%0A
    
+ 
 define(d
@@ -103,31 +103,9 @@
 ;%0A  
-  %7D%0A%0A    // Node.js%0A   
+%7D
  els
@@ -161,24 +161,35 @@
 orts) %7B%0A    
+// Node.js%0A
     module.e
@@ -213,20 +213,24 @@
 on();%0A  
-  %7D%0A
+%7D else %7B
 %0A    // 
@@ -241,23 +241,8 @@
 ser%0A
-    else %7B%0A    
     
@@ -270,18 +270,16 @@
 tion();%0A
-  
   %7D%0A%7D)('

Tidy up indentation of UMD loader