function shallowClone(item) {
  if (typeof item === 'object') {
    // Return copy of instance and prototype chain (in case item is instantiated class).
    return Object.assign(
      Object.create(
        Object.getPrototypeOf(item)
      ),
      item
    );
  }

  return item;
}
Many objects in the config can be an object whose properties are not serializable.
We use a shallow clone for these objects instead.
Any value that isn't an object will not be cloned.

@template T
@param {T} item
@return {T}