function hasChanged(source, target) {
  const sourceKeys = Object.keys(source);
  const targetKeys = Object.keys(target);

  if (sourceKeys.length !== targetKeys.length) {
    return true;
  } else {
    return sourceKeys.some((sourceKey) => {
      return source[sourceKey] !== target[sourceKey];
    })
  }
}

export default hasChanged;

@@ -31,16 +31,104 @@
 rget) %7B%0A
+  if (!source) %7B%0A    return !!target;%0A  %7D else if (!target) %7B%0A    return !!source;%0A  %7D%0A%0A
   const 

Allow hasChanged to handle null and undefined values