function isPlainObject(obj) {
  if (typeof obj !== 'object' || obj === null) return false;

  let proto = obj;
  while (Object.getPrototypeOf(proto) !== null) {
    proto = Object.getPrototypeOf(proto);
  }

  return Object.getPrototypeOf(obj) === proto;
}
We create our own immer instance to avoid potential issues with autoFreeze
becoming default enabled everywhere. We want to disable autofreeze as it
does not suit the design of Easy Peasy.
https://github.com/immerjs/immer/issues/681#issuecomment-705581111