code: function toPlain(map) {
  
    var split;
  
    var form = {};
    var throwErr = function throwErr(key) {
      return log.error('map field name "' + key + '" is invalid');
    };
    var isInvalidKey = function isInvalidKey(str) {
      return str.split('.').length > 1;
    };
    var run = function run(n, o, p) {
      if (o.hasOwnProperty(p)) {
        n += '.' + p;
        if (typeof o[p] === 'string' || typeof o[p] === 'number' || typeof o[p] === 'boolean' || o[p] === undefined || o[p] === null) {
          n = n.substring(1);
          form[n] = o[p];
        } else {
          for (var k in o[p]) {
            if (isInvalidKey(k)) throwErr(k);
            run(n, o[p], k);
          }
        }
      }
    };
  
    for (var p in map) {
      if (isInvalidKey(p)) throwErr(p);
      run('', map, p);
    }
  
    return form;
  }
docs: Nested to plain.