function cleanFieldNames(object) {
  for (var field in object) {
    if (!Object.prototype.hasOwnProperty.call(object, field)) {
      continue;
    }
    var value = object[field];
    if (field.indexOf('.') !== 0) {
      delete object[field];
      field = field.replace('.', '[dot]');
      object[field] = value;
    }
    if (field.indexOf('$') === 0) {
      delete object[field];
      field = field.replace('$', '[$]');
      object[field] = value;
    }
    if (typeof value === 'object') {
      cleanFieldNames(value);
    }
  }
}
/**
 * Removes unexpected characters from metadata field names.
 * @param {Object} object Object to clean
 */
Removes unexpected characters from metadata field names.
@param {Object} object Object to clean
Removes unexpected characters from metadata field names . @param { Object } object Object to clean
function cleanFieldNames(object) {
  for (var field in object) {
    if (!Object.prototype.hasOwnProperty.call(object, field)) {
      continue;
    }
    var value = object[field];
    if (field.indexOf('.') !== 0) {
      delete object[field];
      field = field.replace('.', '[dot]');
      object[field] = value;
    }
    if (field.indexOf('$') === 0) {
      delete object[field];
      field = field.replace('$', '[$]');
      object[field] = value;
    }
    if (typeof value === 'object') {
      cleanFieldNames(value);
    }
  }
}
function cleanFieldNames ( object ) { for ( var field in object ) { if ( ! Object . prototype . hasOwnProperty . call ( object , field ) ) { continue ; } var value = object [ field ] ; if ( field . indexOf ( '.' ) !== 0 ) { delete object [ field ] ; field = field . replace ( '.' , '[dot]' ) ; object [ field ] = value ; } if ( field . indexOf ( '$' ) === 0 ) { delete object [ field ] ; field = field . replace ( '$' , '[$]' ) ; object [ field ] = value ; } if ( typeof value === 'object' ) { cleanFieldNames ( value ) ; } } }
Removes unexpected characters from metadata field names.
Removes unexpected characters from metadata field names .