Obsidian Vault API TAbstractFile - How to tell if Folder or File?

What is the best way to test whether an AbstractFile is a file or folder?
I have a list of children to a folder but wish to test for subfolders.
I cannot use the extension because of files without extensions and dotfiles. I thought there might be a isFolder or Type property, however, I cannot find one.

would I be right in thinking files only has a basename property

  if (entry instanceof TFile) {
    // do something
  } else if (entry instanceof TFolder) {
    // do other thing