pathTo function

String pathTo(
  1. String path
)

Normalizes and joins a given path with the application base directory path.

This function normalizes the input path, formats it as a URI, applies additional path normalization, and finally joins it with the application directory path obtained from pathApp.

Example usage:

String fullPath = pathTo('assets/images');

Implementation

String pathTo(String path) {
  path = p.normalize(path);
  path = p.prettyUri(path);
  path = pathNorm(path);
  return p.normalize(p.join(pathApp, path));
}