Gets rid of unnecessary keys in an object
and if the only keys in an object are `$t` or `$t` and `type`
it makes the whole object the value of `$t`
otherwise it renames `$t` to `text` for consistency.

@param {Object}
@returns {Object}
964762
function cleanObject(obj) {
  if (obj.$t !== undefined) {
    let keysLength = Object.keys(obj).length;
    if (keysLength === 1 || (keysLength === 2 && obj.type !== undefined)) {
      return obj.$t;
    } else {
      obj.text = obj.$t;
      delete obj.$t;
    }
  }

  return obj;
}
278685
function transformStyle(object) {
  if ((0, _has2.default)(object, 'style')) {
    object.style = (0, _transform2.default)((0, _split2.default)(object.style, ';'), (result, style) => {
      const firstColon = style.indexOf(':'),
            key = (0, _trim2.default)(style.substr(0, firstColon));

      if (key) {
        result[toJSXKey((0, _toLower2.default)(key))] = (0, _trim2.default)(style.substr(firstColon + 1));
      }
    }, {});
  }
}
199696
function coerceAll (obj) {
  var type = Array.isArray(obj) ? 'array' : typeof obj;
  var i;
  var n;

  switch (type) {
    case 'string':
      return coerce(obj);
    case 'object':
      if (obj) {
        var props = Object.keys(obj);
        for (i = 0, n = props.length; i < n; i++) {
          var key = props[i];
          obj[key] = coerceAll(obj[key]);
        }
      }
      break;
    case 'array':
      for (i = 0, n = obj.length; i < n; i++) {
        coerceAll(obj[i]);
      }
      break;
  }

  return obj;
}
327916
function simpleStringify (object) {
	var simpleObject = {};
	for (var prop in object) {
		if (!object.hasOwnProperty(prop) ||
			typeof(object[prop]) === 'function') {
			continue;
		}
		simpleObject[prop] = object[prop];
	}
	return JSON.stringify(simpleObject, censor(simpleObject),2);
}
1101356
function (trans, val) {
		var key,
			tmpArr = {},
			isArr = $.isArray(trans);
		for (key in trans) {
			if (isArr || trans.hasOwnProperty(key)) {
				tmpArr[trans[key]] = val || key;
			}
		}
		return tmpArr;
	}
821119
function() {
		canReflect.removeValues(this.replaceStateKeys, canReflect.toArray(arguments));
		canReflect.removeValues(this.replaceStateOnceKeys, canReflect.toArray(arguments));
	}
543299
function readObjectValue(object) {
	let result = ''

	if (typeof object === 'string' || object instanceof String) {
		result = object
	} else if (typeof object === 'number' || object instanceof Number) {
		result = object.toString()
	} else if (object) {
		Object.keys(object).forEach(key => {
			result += key + ': ' + object[key] + '\t'
		})
	}

	if (!result.length) {
		result = 'Not Specified'
	}

	return result.replace(new RegExp('"', 'g'), '""')
}
288630
function() {
			return gui.Object.map(this, function(key, value) {
				var c = key.charAt(0);
				if (c !== "$" && c !== "_") {
					if (edb.Type.is(value)) {
						return value.toJSON();
					}
					return value;
				}
			});
		}
1052788
function(data) {
        var keys = Object.keys(data);
        var values = keys.map(function(key) {
            return escape(data[key], true);
        });

        return '(' + keys.join(', ') + ') VALUES (' + values.join(', ') + ')' 
    }
946072
function (key, fn) {
    if (typeof key === 'function') {
      fn = key;
      key = null;
    }
    if (typeof fn !== 'function') {
      fn = this.pickOption('renameKey');
    }
    if (typeof fn !== 'function') {
      fn = utils.identity;
    }

    this.options.renameKey = fn;
    if (arguments.length === 2) {
      return fn(key);
    }
    if (typeof key === 'string') {
      return fn(key);
    }
    return fn;
  }
1284634
function cleanKey(key, dtype) {
  return (
    key === null ? ESCAPED_KEYS.null :
    isUndefined(key) ? ESCAPED_KEYS.undefined :
    dtype === 'date' ? key.valueOf() :
    key
  );
}
619741
function replacer(str, obj) {
        if (!str || !obj) {
          return;
        }
        if (obj) {
          for (var key in obj) {
            if (str) {
              str = str.split('${' + key + '}').join(obj[key]);
            }
          }
        }
        return str;
      }
28399
function remove_null_undefined(object) {
  Object.keys(object).forEach(key => {
    if (object[key] === null || typeof object[key] === "undefined") {
      delete object[key]
    }
  })

  return object
}
341915
def t(key, options = {})
      if (val = super) =~ /class.+?translation_missing/
        val = val.to_s.gsub(/<span[^>]*>/, 'i18n: ').gsub('</span>', '').gsub(', ', '.')
      end

      val
    end
1007318
function clean(obj) {
  var ret = {};

  // Remove traits/properties that are already represented
  // outside of the data container
  // TODO: Refactor into `omit` call
  var excludeKeys = ['id', 'name', 'firstName', 'lastName'];
  each(excludeKeys, function(omitKey) {
    clear(obj, omitKey);
  });

  // Flatten nested hierarchy, preserving arrays
  obj = flatten(obj);

  // Discard nulls, represent arrays as comma-separated strings
  // FIXME: This also discards `undefined`s. Is that OK?
  for (var key in obj) {
    if (has.call(obj, key)) {
      var val = obj[key];
      if (val == null) {
        continue;
      }

      if (is.array(val)) {
        ret[key] = val.toString();
        continue;
      }

      ret[key] = val;
    }
  }

  return ret;
}
515610
function transformKeysToCamelCase (obj) {
  var camelKey;
  var key;
  for (key in obj) {
    camelKey = toCamelCase(key);
    if (key === camelKey) { continue; }
    obj[camelKey] = obj[key];
    delete obj[key];
  }
  return obj;
}
108771
function textObjectManipulation(cm, object, remove, insert, inclusive) {
    // Object is the text object, delete object if remove is true, enter insert
    // mode if insert is true, inclusive is the difference between a and i
    var tmp = textObjects[object](cm, inclusive);
    var start = tmp.start;
    var end = tmp.end;

    if ((start.line > end.line) || (start.line == end.line && start.ch > end.ch)) var swap = true ;

    pushInBuffer(cm.getRange(swap ? end : start, swap ? start : end));
    if (remove) cm.replaceRange("", swap ? end : start, swap ? start : end);
    if (insert) cm.setOption('keyMap', 'vim-insert');
  }