function toBoolean(value) {
  if (typeof value === 'function') {
    value = true;
  } else if (value && value.length !== 0) {
    var v = lowercase("" + value);
    value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
  } else {
    value = false;
  }
  return value;
}
@ngdoc function
@name angular.fromJson
@function

@description
Deserializes a JSON string.

@param {string} json JSON string to deserialize.
@returns {Object|Array|Date|string|number} Deserialized thingy.