code: function cast(type, value) {
  
      switch (type) {
        case 'boolean':
        case 'integer':
        case 'long':
        case 'float':
        case 'double':
          return '' + value;
  
        case 'liststring':
          if (value instanceof Array)
            return value.join('|');
      }
  
      if (typeof value === 'object')
        throw Error('gexf.writer.cast: trying to cast an object to a string.');
  
      return value;
    }
docs: Helpers