export function safeAccess(obj, str) {
  return str.split('.').reduce(function (o, k) {
    return o ? o[k] : undefined;
  }, obj);
}
;
export function safeWrite(obj, str, value) {
  var segs = str.split('.');
  var key = segs.pop();
  var leaf = segs.reduce(function (o, k) {
    if (!o[k]) {
      o[k] = {};
    }
    return o[k];
  }, obj);
  if (typeof key === 'string') {
    leaf[key] = value;
  }
}
;