Ionic v4 & Ionic Native v5 -- Wildcard File Search?

I’m trying to create a relatively simple app that will create new file entries with incrementing file names, with a naming scheme of [FileType]-[FileNumber].ext.

An example would be if I have files:
“TypeA-1.ext”
“TypeA-2.ext”
“TypeB-1.ext”
…and I wanted to create a new “TypeB” file, I want to be able to say “Get me a count of all files in given directory where some part of the file name matches ‘TypeB’, then add one for the new TypeB’s FileNumber value.”

I do not want to just get a count of all files in the given directory. I can work out the logic behind “Get me an array of objects representing each fiole, create a count variable, loop through the array of objects and increment the count for each object where ‘name’ matches my wildcard string,” but I imagine that could become costly and slow when I have a lot of files to work with.

So if there any natively-supported way to do a wildcard search and get a count of matching files returned?