asLink function

Link asLink(
  1. FileSystemEntity link
)

convert to a link object if necessary

Implementation

Link asLink(FileSystemEntity link) {
  if (link is Link) {
    return link;
  } else {
    return link.fs.link(link.path);
  }
}