631
632
const resultExpression: ParsedStringPattern = function (path: string, basename?: string) {
633
>
let resultPromises: Promise<string | null>[] | undefined = undefined;
glob.ts
634
>
635
>
for (let i = 0, n = parsedPatterns.length; i < n; i++) {
636
>
const result = parsedPatterns[i](path, basename);
637
>
if (typeof result === 'string') {
638
return result; // immediately return as soon as the first expression matches
639
}
641
>
// If the result is a promise, we have to keep it for
642
>
// later processing and await the result properly.
643
>
if (isThenable(result)) {
644
if (!resultPromises) {
645
resultPromises = [];