function setSafeProperty(object, prop, value) {
  // only allow setting safe properties of a plain object
  if (isPlainObject(object) && isSafeProperty(object, prop)) {
    object[prop] = value;
    return value;
  }

  throw new Error('No access to property "' + prop + '"');
}
Set a property on a plain object.
Throws an error in case the object is not a plain object or the
property would override an inherited property like .constructor or .toString
@param {Object} object
@param {string} prop
@param {*} value
@return {*} Returns the value