alexperrault/passport-trakt

View on GitHub
lib/profile.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Parse profile.
 *
 * @param {Object|String} json
 * @return {Object}
 * @api private
 */
exports.parse = function(json) {
  if ('string' == typeof json) {
    json = JSON.parse(json);
  }
  
  var profile = {};
  profile.id = json.username;
  profile.username = json.name;
  
  return profile;
};