src/utils/shared.js
function resourcePath(resourceId, dest = '') {
  const subPath = idKeys(resourceId);
  // Remove first item because it is the "resource type"
  // If there _is_ only one item in the ID, it will be left alone
  // To serve as the filename.
  if (subPath.length !== 0 && subPath.length > 1) {
    subPath.shift();
  }
  const filename = subPath.pop() + '.html';
  const outputPath = path.normalize(
    path.join(dest, subPath.join(path.sep), filename)
  );
  return outputPath;
}
function resourcePath(resourceId, dest = '') {
  const subPath = idKeys(resourceId);
  // Remove first item because it is the "resource type"
  // If there _is_ only one item in the ID, it will be left alone
  // To serve as the filename.
  if (subPath.length !== 0 && subPath.length > 1) {
    subPath.shift();
  }
  const filename = subPath.pop() + '.html';
  const outputPath = path.normalize(
    path.join(dest, subPath.join(path.sep), filename)
  );
  return outputPath;
}
function resourcePath ( resourceId , dest = '' ) { const subPath = idKeys ( resourceId ) ; // Remove first item because it is the "resource type" // If there _is_ only one item in the ID, it will be left alone // To serve as the filename. if ( subPath . length !== 0 && subPath . length > 1 ) { subPath . shift ( ) ; } const filename = subPath . pop ( ) + '.html' ; const outputPath = path . normalize ( path . join ( dest , subPath . join ( path . sep ) , filename ) ) ; return outputPath ; }
Generate a path for a resource based on its ID.
@param {String} resourceId   '.'-separated ID for this resource
@param {String} dest         This path will be prepended
@return {String} path
Generate a path for a resource based on its ID .