lib/data-store/resource.js
function getCollectionFromPath (path) {
  path = _(path).toString();
  let lastSlash = path.substring(0, path.length - 1).lastIndexOf("/");
  if (lastSlash === -1) {
    return "";
  }
  else {
    return normalizeCollection(path.substring(0, lastSlash));
  }
}
function getCollectionFromPath (path) {
  path = _(path).toString();
  let lastSlash = path.substring(0, path.length - 1).lastIndexOf("/");
  if (lastSlash === -1) {
    return "";
  }
  else {
    return normalizeCollection(path.substring(0, lastSlash));
  }
}
function getCollectionFromPath ( path ) { path = _ ( path ) . toString ( ) ; let lastSlash = path . substring ( 0 , path . length - 1 ) . lastIndexOf ( "/" ) ; if ( lastSlash === - 1 ) { return "" ; } else { return normalizeCollection ( path . substring ( 0 , lastSlash ) ) ; } }
Returns the normalized collection path from the given full resource path.

@param   {string}    path - The full resource path (e.g. "/restaurants/washington/seattle/joes-diner")
@returns {string}         - The normalized collection path (e.g. "/restaurants/washington/seattle")
Returns the normalized collection path from the given full resource path .