The states a folder named `name` leads to from `states`; `walking` skips what pnpm's walk skips.
(glob: GlobSegment[], states: Set<number>, name: string, walking: boolean)
| 1024 | |
| 1025 | /** The states a folder named `name` leads to from `states`; `walking` skips what pnpm's walk skips. */ |
| 1026 | function globStep(glob: GlobSegment[], states: Set<number>, name: string, walking: boolean): Set<number> { |
| 1027 | const next = new Set<number>(); |
| 1028 | const hidden = walking && (name.startsWith('.') || GLOB_SKIP_DIRS.has(name)); |
| 1029 | for (const i of states) { |
| 1030 | const seg = glob[i]; |
| 1031 | if (!seg) continue; |
| 1032 | if (seg.globstar) { |
| 1033 | if (!hidden && !(walking && GLOBSTAR_SKIP_DIRS.has(name))) next.add(i); |
| 1034 | } else if (seg.re ? !hidden && seg.re.test(name) : seg.text === name) { |
| 1035 | next.add(i + 1); |
| 1036 | } |
| 1037 | } |
| 1038 | return globClosure(glob, next); |
| 1039 | } |
| 1040 | |
| 1041 | /** `states` with every `**` that can match no folder at all stepped over. */ |
| 1042 | function globClosure(glob: GlobSegment[], states: Set<number>): Set<number> { |
no test coverage detected