Skip to content

Commit 67ad25d

Browse files
committed
renamed "Skipped" to "Remainder" for clarity
1 parent 0e51a72 commit 67ad25d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,46 +112,46 @@ type Exists<T> = T extends never
112112
;
113113
type AsSkippedEscape<
114114
T extends string,
115-
Infer extends T extends `\\${string}${infer Skipped}`
116-
? Skipped
115+
Infer extends T extends `\\${string}${infer Remainder}`
116+
? Remainder
117117
: never
118118
> = Exists<Infer>;
119119
type AsSkippedCharacterClass<
120120
T extends string,
121-
Infer extends unknown extends AsSkippedEscape<T, infer Skipped>
122-
? Skipped
121+
Infer extends unknown extends AsSkippedEscape<T, infer Remainder>
122+
? Remainder
123123
: T extends `[${infer Rest}`
124124
? ResolveCharacterClass<Rest>
125125
: never
126126
> = Exists<Infer>;
127127
type AsSkippedGroup<
128128
T extends string,
129-
Infer extends unknown extends AsSkippedCharacterClass<T, infer Skipped>
130-
? Skipped
129+
Infer extends unknown extends AsSkippedCharacterClass<T, infer Remainder>
130+
? Remainder
131131
: T extends `(${infer Rest}`
132132
? ResolveGroup<Rest>
133133
: never
134134
> = Exists<Infer>;
135135

136136
type ResolveCharacterClass<T extends string> = T extends `${infer First}${infer Rest}`
137-
? unknown extends AsSkippedEscape<T, infer Skipped>
138-
? ResolveCharacterClass<Skipped>
137+
? unknown extends AsSkippedEscape<T, infer Remainder>
138+
? ResolveCharacterClass<Remainder>
139139
: First extends ']'
140140
? Rest
141141
: ResolveCharacterClass<Rest>
142142
: never
143143
;
144144
type ResolveGroup<T extends string> = T extends `${infer First}${infer Rest}`
145-
? unknown extends AsSkippedGroup<T, infer Skipped>
146-
? ResolveGroup<Skipped>
145+
? unknown extends AsSkippedGroup<T, infer Remainder>
146+
? ResolveGroup<Remainder>
147147
: First extends ')'
148148
? Rest
149149
: ResolveGroup<Rest>
150150
: never
151151
;
152152
type ResolveAlternation<T extends string> = T extends `${infer First}${infer Rest}`
153-
? unknown extends AsSkippedGroup<T, infer Skipped>
154-
? ResolveAlternation<Skipped>
153+
? unknown extends AsSkippedGroup<T, infer Remainder>
154+
? ResolveAlternation<Remainder>
155155
: First extends '|'
156156
? Rest
157157
: ResolveAlternation<Rest>
@@ -190,8 +190,8 @@ type GroupPatterns<T extends string> = T extends `?<${infer Name}>${infer TheRes
190190
}
191191
;
192192
type GroupsTree<T extends string> = T extends `${string}${infer Rest}`
193-
? unknown extends AsSkippedCharacterClass<T, infer Skipped>
194-
? GroupsTree<Skipped>
193+
? unknown extends AsSkippedCharacterClass<T, infer Remainder>
194+
? GroupsTree<Remainder>
195195
: unknown extends As<ResolveGroup<Rest>, infer Tail>
196196
? T extends `(${infer Content})${Tail}`
197197
? [

0 commit comments

Comments
 (0)