Change JSON patternProperties to RAML pattern properties.

@param  {Object} data
@returns  {Object}
341967
function convertPatternProperties (data) {
  if (!data.patternProperties) {
    return data
  }
  data.properties = data.properties || {}
  const patternProperties = data.patternProperties
  delete data.patternProperties
  Object.keys(patternProperties).map(function (pattern) {
    data.properties['/' + pattern + '/'] = patternProperties[pattern]
  })
  if (data.additionalProperties) delete data.additionalProperties
  return data
}
39660
function (data) {

                        var lines = data.match(/[^\r\n]+/g); //cut lines

                        return lines.map(function (line) {
                            try {
                                return JSON.parse(line);
                            } catch (e) {
                                return line;
                            }
                        });
                    }
1015545
function convertDateType (data) {
  if (!(data.type === 'string' && data.pattern)) {
    return data
  }
  const pattern = data.pattern
  delete data.pattern
  switch (pattern) {
    case constants.dateOnlyPattern:
      data['type'] = 'date-only'
      break
    case constants.timeOnlyPattern:
      data['type'] = 'time-only'
      break
    case constants.dateTimeOnlyPattern:
      data['type'] = 'datetime-only'
      break
    case constants.RFC3339DatetimePattern:
      data['type'] = 'datetime'
      data['format'] = constants.RFC3339
      break
    case constants.RFC2616DatetimePattern:
      data['type'] = 'datetime'
      data['format'] = constants.RFC2616
      break
    default:
      data['pattern'] = pattern
  }
  return data
}
503370
function js2dt (jsonData, typeName) {
  const data = JSON.parse(jsonData)

  const raml = new RamlConverter(data, typeName).toRaml()

  return raml
}
1299991
function(data) {
    var flat_data = [];

    if (typeof data.length === 'undefined') {
      if (typeof data === 'object') {
        for (var key in data) {
          if (data.hasOwnProperty(key))
            flat_data = flat_data.concat(this.flatten(data[key]));
        }
      } else {
        return [];
      }
    }

    for (var i = 0; i < data.length; i++) {
      if (typeof data[i].length === 'number') {
        flat_data = flat_data.concat(this.flatten(data[i]));
      } else {
        flat_data.push(data[i]);
      }
    }
    return flat_data;
  }
1021662
function jsonStringify(object, spaces, depth) {
  if (typeof spaces === 'undefined') {
    // primitive types
    return _stringify(object);
  }

  depth = depth || 1;
  var space = spaces * depth;
  var str = Array.isArray(object) ? '[' : '{';
  var end = Array.isArray(object) ? ']' : '}';
  var length =
    typeof object.length === 'number'
      ? object.length
      : Object.keys(object).length;
  // `.repeat()` polyfill
  function repeat(s, n) {
    return new Array(n).join(s);
  }

  function _stringify(val) {
    switch (type(val)) {
      case 'null':
      case 'undefined':
        val = '[' + val + ']';
        break;
      case 'array':
      case 'object':
        val = jsonStringify(val, spaces, depth + 1);
        break;
      case 'boolean':
      case 'regexp':
      case 'symbol':
      case 'number':
        val =
          val === 0 && 1 / val === -Infinity // `-0`
            ? '-0'
            : val.toString();
        break;
      case 'date':
        var sDate = isNaN(val.getTime()) ? val.toString() : val.toISOString();
        val = '[Date: ' + sDate + ']';
        break;
      case 'buffer':
        var json = val.toJSON();
        // Based on the toJSON result
        json = json.data && json.type ? json.data : json;
        val = '[Buffer: ' + jsonStringify(json, 2, depth + 1) + ']';
        break;
      default:
        val =
          val === '[Function]' || val === '[Circular]'
            ? val
            : JSON.stringify(val); // string
    }
    return val;
  }

  for (var i in object) {
    if (!Object.prototype.hasOwnProperty.call(object, i)) {
      continue; // not my business
    }
    --length;
    str +=
      '\n ' +
      repeat(' ', space) +
      (Array.isArray(object) ? '' : '"' + i + '": ') + // key
      _stringify(object[i]) + // value
      (length ? ',' : ''); // comma
  }

  return (
    str +
    // [], {}
    (str.length !== 1 ? '\n' + repeat(' ', --space) + end : end)
  );
}
318514
function sanitize (data) {
  if (
    !isPrimitive(data) &&
    !Array.isArray(data) &&
    !isPlainObject(data)
  ) {
    // handle types that will probably cause issues in
    // the structured clone
    return Object.prototype.toString.call(data)
  } else {
    return data
  }
}
1213278
function(data) {
    // Empty data
    if (_.isEmpty(data)) {
      // Return [] or null
      return _.isArray(data) ? data : null;
    }

    // Array data
    if (_.isArray(data)) {
      return data.map(obj => this._toJSON(obj));
    }

    // Single data
    if (typeof data.toJSON === 'function') {
      return data.toJSON();
    }

    return data;
  }
304063
function convertDateType (data) {
  switch (data.type) {
    case 'date-only':
      data['type'] = 'string'
      data['pattern'] = constants.dateOnlyPattern
      break
    case 'time-only':
      data['type'] = 'string'
      data['pattern'] = constants.timeOnlyPattern
      break
    case 'datetime-only':
      data['type'] = 'string'
      data['pattern'] = constants.dateTimeOnlyPattern
      break
    case 'datetime':
      data['type'] = 'string'
      if (data.format === undefined || data.format.toLowerCase() === constants.RFC3339) {
        data['pattern'] = constants.RFC3339DatetimePattern
      } else if (data.format.toLowerCase() === constants.RFC2616) {
        data['pattern'] = constants.RFC2616DatetimePattern
      }
      delete data.format
      break
  }
  return data
}
950214
function(data){
		return typeof data === 'object' 
			? JSON.stringify(data) 
			: (typeof data === 'string' || typeof data === 'number' ? String(data) : null);
	}
58761
function transform( data ) {
	var rows = data.rows;
	var out;
	var i;
	out = new Array( rows.length );
	for ( i = 0; i < rows.length; i++ ) {
		out[ i ] = rows[ i ].key[ 1 ];
	}
	return out;
}
880411
function transformer(data) {
        var newData = {};
        var keys = Object.keys(data), length = keys.length, key, i;
        for ( i = 0; i < length; i++) {
          key = keys[i];
          newData[key] = data[key];
        }
        return newData;
      }
411335
function replaceAll(str = '', pattern, replacement) {
	if (arguments.length < 2 ){
		return str;
	}

	let rs = str;
	if (lodash.isPlainObject(pattern)){
		for (let key in pattern){
			rs = rs.replace(new RegExp('{' + key + '}', "gm"), pattern[key])
		}
	}else {
		rs = rs.replace(new RegExp(pattern, "gm"), replacement)
	}

	return rs;
}
1191956
function stringify(data, options = {}) {
  const _options$strict = options.strict,
        strict = _options$strict === void 0 ? false : _options$strict;
  return baseFormat(data, strict);
}
1310038
def to_internal_value(self, data):
        
        if 'properties' in data:
            data = self.unformat_geojson(data)
        return super(GeoFeatureModelSerializer, self).to_internal_value(data)
1065255
function (data) {
    var schema = this.schema;
    if (typeof data === 'string') { return data; }
    if (this.isSingleProperty) { return stringifyProperty(data, schema); }
    data = stringifyProperties(data, schema);
    return styleParser.stringify(data);
  }
507838
function(varsData) {
    if (isJSON(varsData)) {
      // JSON variables
      varsData = JSON.parse(varsData);

      for (var key in varsData) {
        if (varsData.hasOwnProperty(key)) {
          this.vars[normalizeVarName(key)] = varsData[key];
        }
      }
    }
    else {
      // Sass variables
      var pattern = /\$([^\s:]+)\s*:\s*([^!;]+)/g;
      var match = pattern.exec(varsData);

      while (match) {
        this.vars[ match[1] ] = match[2].trim();
        match = pattern.exec(varsData);
      }
    }
  }