dist/ember-json-api.js
function(links, resource) {
        var link, association, id, route, relationshipLink, cleanedRoute;

        // Clear the old format
        resource.links = {};

        for (link in links) {
          association = links[link];
          link = Ember.String.camelize(link.split('.').pop());

          if(!association) {
            continue;
          }

          if (typeof association === 'string') {
            if (association.indexOf('/') > -1) {
              route = association;
              id = null;
            } else { // This is no longer valid in JSON API. Potentially remove.
              route = null;
              id = association;
            }
            relationshipLink = null;
          } else {
            if (association.links) {
              relationshipLink =  association.links[this.relationshipKey];
              route = association.links[this.relatedResourceKey];
            }
            id = getLinkageId(association.data);
          }

          if (route) {
            cleanedRoute = this.removeHost(route);
            resource.links[link] = cleanedRoute;

            // Need clarification on how this is used
            if (cleanedRoute.indexOf('{') > -1) {
              DS._routes[link] = cleanedRoute.replace(/^\//, '');
            }
          }
          if (id) {
            resource[link] = id;
          }
        }
        return resource.links;
      }
function(links, resource) {
        var link, association, id, route, relationshipLink, cleanedRoute;

        // Clear the old format
        resource.links = {};

        for (link in links) {
          association = links[link];
          link = Ember.String.camelize(link.split('.').pop());

          if(!association) {
            continue;
          }

          if (typeof association === 'string') {
            if (association.indexOf('/') > -1) {
              route = association;
              id = null;
            } else { // This is no longer valid in JSON API. Potentially remove.
              route = null;
              id = association;
            }
            relationshipLink = null;
          } else {
            if (association.links) {
              relationshipLink =  association.links[this.relationshipKey];
              route = association.links[this.relatedResourceKey];
            }
            id = getLinkageId(association.data);
          }

          if (route) {
            cleanedRoute = this.removeHost(route);
            resource.links[link] = cleanedRoute;

            // Need clarification on how this is used
            if (cleanedRoute.indexOf('{') > -1) {
              DS._routes[link] = cleanedRoute.replace(/^\//, '');
            }
          }
          if (id) {
            resource[link] = id;
          }
        }
        return resource.links;
      }
function ( links , resource ) { var link , association , id , route , relationshipLink , cleanedRoute ; // Clear the old format resource . links = { } ; for ( link in links ) { association = links [ link ] ; link = Ember . String . camelize ( link . split ( '.' ) . pop ( ) ) ; if ( ! association ) { continue ; } if ( typeof association === 'string' ) { if ( association . indexOf ( '/' ) > - 1 ) { route = association ; id = null ; } else { // This is no longer valid in JSON API. Potentially remove. route = null ; id = association ; } relationshipLink = null ; } else { if ( association . links ) { relationshipLink = association . links [ this . relationshipKey ] ; route = association . links [ this . relatedResourceKey ] ; } id = getLinkageId ( association . data ) ; } if ( route ) { cleanedRoute = this . removeHost ( route ) ; resource . links [ link ] = cleanedRoute ; // Need clarification on how this is used if ( cleanedRoute . indexOf ( '{' ) > - 1 ) { DS . _routes [ link ] = cleanedRoute . replace ( / ^\/ / , '' ) ; } } if ( id ) { resource [ link ] = id ; } } return resource . links ; }
Parse the top-level "links" object.
Parse the top - level links object .