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(link.path);
  }
}