lib/utils.js
function get_association_keys(collection) {
  // Loop over the keys, filter irrelevant ones and fetch alias'
  return Object.keys(collection._attributes || collection.attributes)
    // We only care about attributes with model, collection or foreignKey properties.
    .filter(key =>
      collection._attributes[key].hasOwnProperty("model") ||
      collection._attributes[key].hasOwnProperty("collection") ||
      (
        collection._attributes[key].hasOwnProperty("foreignKey") &&
        collection._attributes[key].hasOwnProperty("references")
      )
    )
}
function get_association_keys(collection) {
  // Loop over the keys, filter irrelevant ones and fetch alias'
  return Object.keys(collection._attributes || collection.attributes)
    // We only care about attributes with model, collection or foreignKey properties.
    .filter(key =>
      collection._attributes[key].hasOwnProperty("model") ||
      collection._attributes[key].hasOwnProperty("collection") ||
      (
        collection._attributes[key].hasOwnProperty("foreignKey") &&
        collection._attributes[key].hasOwnProperty("references")
      )
    )
}
function get_association_keys ( collection ) { // Loop over the keys, filter irrelevant ones and fetch alias' return Object . keys ( collection . _attributes || collection . attributes ) // We only care about attributes with model, collection or foreignKey properties. . filter ( key => collection . _attributes [ key ] . hasOwnProperty ( "model" ) || collection . _attributes [ key ] . hasOwnProperty ( "collection" ) || ( collection . _attributes [ key ] . hasOwnProperty ( "foreignKey" ) && collection . _attributes [ key ] . hasOwnProperty ( "references" ) ) ) }
Get the keys that are associations.
@param  {Waterline.Collection} collection to get keys from.
@return {Array} Array of the keys that have model, collection or foreignKey properties.
Get the keys that are associations .