index.js
function mapRecordOptions(options) {
    if (options.type === 'SRV') {
      let contentParts = options.content.split(' ');
      let serverParts = options.name.split('.');
      options.data = {
        service: serverParts[0],
        proto: serverParts[1],
        name: _.slice(serverParts, 2).join('.'),
        priority: parseInt(contentParts[0]),
        weight: parseInt(contentParts[1]),
        port: parseInt(contentParts[2]),
        target: contentParts[3]
      }
    }
    if (options.activate !== undefined) {
      options.proxied = options.activate;
    }
    options = _.omit(options, ['domain', 'email', 'token', '_', 'activate', 'a']);

    return options;
  }
function mapRecordOptions(options) {
    if (options.type === 'SRV') {
      let contentParts = options.content.split(' ');
      let serverParts = options.name.split('.');
      options.data = {
        service: serverParts[0],
        proto: serverParts[1],
        name: _.slice(serverParts, 2).join('.'),
        priority: parseInt(contentParts[0]),
        weight: parseInt(contentParts[1]),
        port: parseInt(contentParts[2]),
        target: contentParts[3]
      }
    }
    if (options.activate !== undefined) {
      options.proxied = options.activate;
    }
    options = _.omit(options, ['domain', 'email', 'token', '_', 'activate', 'a']);

    return options;
  }
function mapRecordOptions ( options ) { if ( options . type === 'SRV' ) { let contentParts = options . content . split ( ' ' ) ; let serverParts = options . name . split ( '.' ) ; options . data = { service : serverParts [ 0 ] , proto : serverParts [ 1 ] , name : _ . slice ( serverParts , 2 ) . join ( '.' ) , priority : parseInt ( contentParts [ 0 ] ) , weight : parseInt ( contentParts [ 1 ] ) , port : parseInt ( contentParts [ 2 ] ) , target : contentParts [ 3 ] } } if ( options . activate !== undefined ) { options . proxied = options . activate ; } options = _ . omit ( options , [ 'domain' , 'email' , 'token' , '_' , 'activate' , 'a' ] ) ; return options ; }
Map options to parameters when adding or editing records
@param options
@return {*}
Map options to parameters when adding or editing records