src/dt2js.js
function convertPatternProperties (data) {
  Object.keys(data.properties).map(function (key) {
    if (/^\/.*\/$/.test(key)) {
      data.patternProperties = data.patternProperties || {}
      const stringRegex = key.slice(1, -1)
      data.patternProperties[stringRegex] = data.properties[key]
      delete data.properties[key]
    }
  })
  return data
}
function convertPatternProperties (data) {
  Object.keys(data.properties).map(function (key) {
    if (/^\/.*\/$/.test(key)) {
      data.patternProperties = data.patternProperties || {}
      const stringRegex = key.slice(1, -1)
      data.patternProperties[stringRegex] = data.properties[key]
      delete data.properties[key]
    }
  })
  return data
}
function convertPatternProperties ( data ) { Object . keys ( data . properties ) . map ( function ( key ) { if ( / ^\/.*\/$ / . test ( key ) ) { data . patternProperties = data . patternProperties || { } const stringRegex = key . slice ( 1 , - 1 ) data . patternProperties [ stringRegex ] = data . properties [ key ] delete data . properties [ key ] } } ) return data }
Change RAML pattern properties to JSON patternProperties.

@param  {Object} data - the library fragment to convert
@returns  {Object}
Change RAML pattern properties to JSON patternProperties .