lib/serializer.js
function createCompoundIncludes (
  relationship,
  key,
  fk,
  type,
  includedRelations,
  options
) {
  var compoundInclude = makeRelation(type, String(relationship[key]))

  if (options && !_.isEmpty(includedRelations)) {
    var defaultModelPath = options.modelPath
    options.modelPath = type

    compoundInclude.relationships = parseRelations(
      relationship,
      includedRelations,
      options
    )

    options.modelPath = defaultModelPath
  }

  // remove the id key since its part of the base compound document, not part of attributes
  delete relationship[key]
  delete relationship[fk]

  // The rest of the data goes in the attributes
  compoundInclude.attributes = relationship

  return compoundInclude
}
function createCompoundIncludes (
  relationship,
  key,
  fk,
  type,
  includedRelations,
  options
) {
  var compoundInclude = makeRelation(type, String(relationship[key]))

  if (options && !_.isEmpty(includedRelations)) {
    var defaultModelPath = options.modelPath
    options.modelPath = type

    compoundInclude.relationships = parseRelations(
      relationship,
      includedRelations,
      options
    )

    options.modelPath = defaultModelPath
  }

  // remove the id key since its part of the base compound document, not part of attributes
  delete relationship[key]
  delete relationship[fk]

  // The rest of the data goes in the attributes
  compoundInclude.attributes = relationship

  return compoundInclude
}
function createCompoundIncludes ( relationship , key , fk , type , includedRelations , options ) { var compoundInclude = makeRelation ( type , String ( relationship [ key ] ) ) if ( options && ! _ . isEmpty ( includedRelations ) ) { var defaultModelPath = options . modelPath options . modelPath = type compoundInclude . relationships = parseRelations ( relationship , includedRelations , options ) options . modelPath = defaultModelPath } // remove the id key since its part of the base compound document, not part of attributes delete relationship [ key ] delete relationship [ fk ] // The rest of the data goes in the attributes compoundInclude . attributes = relationship return compoundInclude }
Creates a compound include object.
@private
@memberOf {Serializer}
@param {Object} relationship
@param {String} key
@param {String} fk
@param {String} type
@param {Object} includedRelations
@param {Object} options
@return {Object}
Creates a compound include object .