arktype 2.0.0-dev.1 → 2.0.0-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/__tests__/array.test.ts +270 -151
  2. package/__tests__/badDefinitionType.test.ts +10 -3
  3. package/__tests__/basis.test.ts +6 -2
  4. package/__tests__/bounds.test.ts +282 -352
  5. package/__tests__/cast.test.ts +7 -2
  6. package/__tests__/completions.test.ts +8 -3
  7. package/__tests__/config.test.ts +95 -167
  8. package/__tests__/dateLiteral.test.ts +8 -4
  9. package/__tests__/declared.test.ts +7 -6
  10. package/__tests__/discrimination.test.ts +1 -1
  11. package/__tests__/divisor.test.ts +46 -22
  12. package/__tests__/enclosed.test.ts +39 -25
  13. package/__tests__/examples.test.ts +56 -56
  14. package/__tests__/expressions.test.ts +184 -112
  15. package/__tests__/generic.test.ts +307 -288
  16. package/__tests__/group.test.ts +67 -54
  17. package/__tests__/imports.test.ts +62 -49
  18. package/__tests__/instanceof.test.ts +25 -23
  19. package/__tests__/intersection.test.ts +52 -48
  20. package/__tests__/keyTraversal.test.ts +77 -73
  21. package/__tests__/keyof.test.ts +68 -52
  22. package/__tests__/keywords.test.ts +164 -138
  23. package/__tests__/literal.test.ts +60 -21
  24. package/__tests__/match.bench.ts +31 -0
  25. package/__tests__/match.test.ts +222 -22
  26. package/__tests__/narrow.test.ts +52 -54
  27. package/__tests__/objectLiteral.test.ts +347 -205
  28. package/__tests__/operator.bench.ts +4 -4
  29. package/__tests__/pipe.test.ts +501 -0
  30. package/__tests__/realWorld.test.ts +63 -0
  31. package/__tests__/regex.test.ts +17 -7
  32. package/__tests__/scope.bench.ts +1 -1
  33. package/__tests__/scope.test.ts +257 -23
  34. package/__tests__/serialization.test.ts +19 -0
  35. package/__tests__/string.test.ts +11 -7
  36. package/__tests__/submodule.test.ts +26 -39
  37. package/__tests__/this.test.ts +83 -57
  38. package/__tests__/thunk.test.ts +13 -7
  39. package/__tests__/traverse.test.ts +76 -54
  40. package/__tests__/tsGenerics.test.ts +12 -12
  41. package/__tests__/type.test.ts +36 -0
  42. package/__tests__/typeReference.test.ts +7 -7
  43. package/__tests__/unenclosed.test.ts +116 -100
  44. package/__tests__/union.test.ts +171 -104
  45. package/ark.ts +21 -65
  46. package/generic.ts +69 -0
  47. package/main.ts +6 -18
  48. package/match.ts +195 -93
  49. package/module.ts +15 -0
  50. package/out/ark.d.ts +15 -39
  51. package/out/ark.js +9 -18
  52. package/out/ark.js.map +1 -1
  53. package/out/generic.d.ts +21 -0
  54. package/out/generic.js +24 -0
  55. package/out/generic.js.map +1 -0
  56. package/out/main.d.ts +6 -7
  57. package/out/main.js +4 -3
  58. package/out/main.js.map +1 -1
  59. package/out/match.d.ts +57 -34
  60. package/out/match.js +51 -17
  61. package/out/match.js.map +1 -1
  62. package/out/module.d.ts +10 -0
  63. package/out/module.js +3 -0
  64. package/out/module.js.map +1 -0
  65. package/out/parser/definition.d.ts +11 -13
  66. package/out/parser/definition.js +10 -13
  67. package/out/parser/definition.js.map +1 -1
  68. package/out/parser/generic.d.ts +5 -7
  69. package/out/parser/generic.js +7 -11
  70. package/out/parser/generic.js.map +1 -1
  71. package/out/parser/objectLiteral.d.ts +45 -14
  72. package/out/parser/objectLiteral.js +61 -52
  73. package/out/parser/objectLiteral.js.map +1 -1
  74. package/out/parser/semantic/bounds.d.ts +10 -8
  75. package/out/parser/semantic/bounds.js +0 -1
  76. package/out/parser/semantic/bounds.js.map +1 -1
  77. package/out/parser/semantic/divisor.d.ts +5 -7
  78. package/out/parser/semantic/divisor.js +0 -1
  79. package/out/parser/semantic/infer.d.ts +24 -0
  80. package/out/parser/semantic/infer.js +1 -0
  81. package/out/parser/semantic/infer.js.map +1 -0
  82. package/out/parser/semantic/utils.d.ts +3 -7
  83. package/out/parser/semantic/utils.js +0 -1
  84. package/out/parser/semantic/validate.d.ts +15 -14
  85. package/out/parser/semantic/validate.js +1 -1
  86. package/out/parser/semantic/validate.js.map +1 -1
  87. package/out/parser/string/reduce/dynamic.d.ts +13 -13
  88. package/out/parser/string/reduce/dynamic.js +31 -26
  89. package/out/parser/string/reduce/dynamic.js.map +1 -1
  90. package/out/parser/string/reduce/shared.d.ts +6 -20
  91. package/out/parser/string/reduce/shared.js +0 -1
  92. package/out/parser/string/reduce/shared.js.map +1 -1
  93. package/out/parser/string/reduce/static.d.ts +27 -24
  94. package/out/parser/string/reduce/static.js +0 -1
  95. package/out/parser/string/shift/operand/date.d.ts +3 -3
  96. package/out/parser/string/shift/operand/date.js +4 -7
  97. package/out/parser/string/shift/operand/date.js.map +1 -1
  98. package/out/parser/string/shift/operand/enclosed.d.ts +4 -19
  99. package/out/parser/string/shift/operand/enclosed.js +12 -13
  100. package/out/parser/string/shift/operand/enclosed.js.map +1 -1
  101. package/out/parser/string/shift/operand/genericArgs.d.ts +9 -10
  102. package/out/parser/string/shift/operand/genericArgs.js +6 -10
  103. package/out/parser/string/shift/operand/genericArgs.js.map +1 -1
  104. package/out/parser/string/shift/operand/operand.d.ts +3 -4
  105. package/out/parser/string/shift/operand/operand.js +8 -12
  106. package/out/parser/string/shift/operand/operand.js.map +1 -1
  107. package/out/parser/string/shift/operand/unenclosed.d.ts +15 -22
  108. package/out/parser/string/shift/operand/unenclosed.js +24 -36
  109. package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
  110. package/out/parser/string/shift/operator/bounds.d.ts +9 -13
  111. package/out/parser/string/shift/operator/bounds.js +43 -54
  112. package/out/parser/string/shift/operator/bounds.js.map +1 -1
  113. package/out/parser/string/shift/operator/divisor.d.ts +2 -4
  114. package/out/parser/string/shift/operator/divisor.js +1 -3
  115. package/out/parser/string/shift/operator/divisor.js.map +1 -1
  116. package/out/parser/string/shift/operator/operator.d.ts +2 -3
  117. package/out/parser/string/shift/operator/operator.js +12 -19
  118. package/out/parser/string/shift/operator/operator.js.map +1 -1
  119. package/out/parser/string/shift/scanner.d.ts +2 -2
  120. package/out/parser/string/shift/scanner.js +14 -16
  121. package/out/parser/string/shift/scanner.js.map +1 -1
  122. package/out/parser/string/string.d.ts +8 -6
  123. package/out/parser/string/string.js +1 -3
  124. package/out/parser/string/string.js.map +1 -1
  125. package/out/parser/tuple.d.ts +102 -43
  126. package/out/parser/tuple.js +119 -87
  127. package/out/parser/tuple.js.map +1 -1
  128. package/out/scope.d.ts +43 -120
  129. package/out/scope.js +39 -209
  130. package/out/scope.js.map +1 -1
  131. package/out/type.d.ts +43 -64
  132. package/out/type.js +30 -131
  133. package/out/type.js.map +1 -1
  134. package/package.json +7 -3
  135. package/parser/definition.ts +77 -93
  136. package/parser/generic.ts +38 -40
  137. package/parser/objectLiteral.ts +172 -136
  138. package/parser/semantic/bounds.ts +33 -32
  139. package/parser/semantic/divisor.ts +8 -10
  140. package/parser/semantic/infer.ts +141 -0
  141. package/parser/semantic/utils.ts +12 -23
  142. package/parser/semantic/validate.ts +81 -73
  143. package/parser/string/reduce/dynamic.ts +67 -55
  144. package/parser/string/reduce/shared.ts +1 -3
  145. package/parser/string/reduce/static.ts +67 -69
  146. package/parser/string/shift/operand/date.ts +15 -14
  147. package/parser/string/shift/operand/enclosed.ts +30 -25
  148. package/parser/string/shift/operand/genericArgs.ts +46 -45
  149. package/parser/string/shift/operand/operand.ts +32 -38
  150. package/parser/string/shift/operand/unenclosed.ts +107 -158
  151. package/parser/string/shift/operator/bounds.ts +118 -112
  152. package/parser/string/shift/operator/divisor.ts +14 -17
  153. package/parser/string/shift/operator/operator.ts +35 -46
  154. package/parser/string/shift/scanner.ts +51 -50
  155. package/parser/string/string.ts +30 -35
  156. package/parser/tuple.ts +375 -307
  157. package/scope.ts +170 -453
  158. package/type.ts +193 -274
  159. package/__tests__/astUtils.test.ts +0 -17
  160. package/__tests__/cyclic.test.ts +0 -144
  161. package/__tests__/jsdoc.test.ts +0 -64
  162. package/__tests__/morph.test.ts +0 -409
  163. package/__tests__/nodeDefinitions.test.ts +0 -190
  164. package/__tests__/typeMethods.test.ts +0 -69
  165. package/out/ark.d.ts.map +0 -1
  166. package/out/arkConfig.d.ts +0 -2
  167. package/out/arkConfig.d.ts.map +0 -1
  168. package/out/arkConfig.js +0 -10
  169. package/out/arkConfig.js.map +0 -1
  170. package/out/main.d.ts.map +0 -1
  171. package/out/match.d.ts.map +0 -1
  172. package/out/parser/definition.d.ts.map +0 -1
  173. package/out/parser/generic.d.ts.map +0 -1
  174. package/out/parser/objectLiteral.d.ts.map +0 -1
  175. package/out/parser/semantic/bounds.d.ts.map +0 -1
  176. package/out/parser/semantic/divisor.d.ts.map +0 -1
  177. package/out/parser/semantic/intersections.d.ts +0 -14
  178. package/out/parser/semantic/intersections.d.ts.map +0 -1
  179. package/out/parser/semantic/intersections.js +0 -2
  180. package/out/parser/semantic/intersections.js.map +0 -1
  181. package/out/parser/semantic/semantic.d.ts +0 -33
  182. package/out/parser/semantic/semantic.d.ts.map +0 -1
  183. package/out/parser/semantic/semantic.js +0 -2
  184. package/out/parser/semantic/semantic.js.map +0 -1
  185. package/out/parser/semantic/utils.d.ts.map +0 -1
  186. package/out/parser/semantic/validate.d.ts.map +0 -1
  187. package/out/parser/shared.d.ts +0 -54
  188. package/out/parser/shared.d.ts.map +0 -1
  189. package/out/parser/shared.js +0 -47
  190. package/out/parser/shared.js.map +0 -1
  191. package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
  192. package/out/parser/string/reduce/shared.d.ts.map +0 -1
  193. package/out/parser/string/reduce/static.d.ts.map +0 -1
  194. package/out/parser/string/shift/operand/date.d.ts.map +0 -1
  195. package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
  196. package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
  197. package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
  198. package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
  199. package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
  200. package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
  201. package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
  202. package/out/parser/string/shift/scanner.d.ts.map +0 -1
  203. package/out/parser/string/string.d.ts.map +0 -1
  204. package/out/parser/tuple.d.ts.map +0 -1
  205. package/out/scope.d.ts.map +0 -1
  206. package/out/test.d.ts +0 -2
  207. package/out/test.d.ts.map +0 -1
  208. package/out/test.js +0 -7
  209. package/out/test.js.map +0 -1
  210. package/out/tsconfig.build.tsbuildinfo +0 -1
  211. package/out/type.d.ts.map +0 -1
  212. package/out/util.d.ts +0 -19
  213. package/out/util.d.ts.map +0 -1
  214. package/out/util.js +0 -7
  215. package/out/util.js.map +0 -1
  216. package/parser/semantic/intersections.ts +0 -46
  217. package/parser/semantic/semantic.ts +0 -144
  218. package/parser/shared.ts +0 -152
  219. package/util.ts +0 -36
@@ -1,4 +1,4 @@
1
- import { isKeyOf, type Dict } from "@arktype/util"
1
+ import { type Dict, isKeyOf } from "@arktype/util"
2
2
  import type { Comparator } from "../reduce/shared.js"
3
3
 
4
4
  export class Scanner<Lookahead extends string = string> {
@@ -11,15 +11,15 @@ export class Scanner<Lookahead extends string = string> {
11
11
  }
12
12
 
13
13
  /** Get lookahead and advance scanner by one */
14
- shift() {
14
+ shift(): Lookahead {
15
15
  return (this.chars[this.i++] ?? "") as Lookahead
16
16
  }
17
17
 
18
- get lookahead() {
18
+ get lookahead(): Lookahead {
19
19
  return (this.chars[this.i] ?? "") as Lookahead
20
20
  }
21
21
 
22
- get length() {
22
+ get length(): number {
23
23
  return this.chars.length
24
24
  }
25
25
 
@@ -27,43 +27,41 @@ export class Scanner<Lookahead extends string = string> {
27
27
  let shifted = ""
28
28
  while (this.lookahead) {
29
29
  if (condition(this, shifted)) {
30
- if (shifted[shifted.length - 1] === Scanner.escapeToken) {
30
+ if (shifted[shifted.length - 1] === Scanner.escapeToken)
31
31
  shifted = shifted.slice(0, -1)
32
- } else {
33
- break
34
- }
32
+ else break
35
33
  }
36
34
  shifted += this.shift()
37
35
  }
38
36
  return shifted
39
37
  }
40
38
 
41
- shiftUntilNextTerminator() {
39
+ shiftUntilNextTerminator(): string {
42
40
  this.shiftUntilNonWhitespace()
43
41
  return this.shiftUntil(Scanner.lookaheadIsTerminator)
44
42
  }
45
43
 
46
- shiftUntilNonWhitespace() {
44
+ shiftUntilNonWhitespace(): string {
47
45
  return this.shiftUntil(Scanner.lookaheadIsNotWhitespace)
48
46
  }
49
47
 
50
- jumpToIndex(i: number) {
48
+ jumpToIndex(i: number): void {
51
49
  this.i = i < 0 ? this.length + i : i
52
50
  }
53
51
 
54
- get location() {
52
+ get location(): number {
55
53
  return this.i
56
54
  }
57
55
 
58
- get unscanned() {
56
+ get unscanned(): string {
59
57
  return this.chars.slice(this.i, this.length).join("")
60
58
  }
61
59
 
62
- get scanned() {
60
+ get scanned(): string {
63
61
  return this.chars.slice(0, this.i).join("")
64
62
  }
65
63
 
66
- sliceChars(start: number, end?: number) {
64
+ sliceChars(start: number, end?: number): string {
67
65
  return this.chars.slice(start, end).join("")
68
66
  }
69
67
 
@@ -128,7 +126,8 @@ export namespace Scanner {
128
126
 
129
127
  export const whiteSpaceTokens = {
130
128
  " ": true,
131
- "\n": true
129
+ "\n": true,
130
+ "\t": true
132
131
  } as const
133
132
 
134
133
  export type WhiteSpaceToken = keyof typeof whiteSpaceTokens
@@ -137,32 +136,32 @@ export namespace Scanner {
137
136
  lookahead: string,
138
137
  unscanned: string
139
138
  ): lookahead is ">" | "," =>
140
- lookahead === ">"
141
- ? unscanned[0] === "="
142
- ? // >== would only occur in an expression like Array<number>==5
143
- // otherwise, >= would only occur as part of a bound like number>=5
144
- unscanned[1] === "="
145
- : // if > is the end of a generic instantiation, the next token will be an operator or the end of the string
146
- unscanned.trimStart() === "" ||
147
- isKeyOf(unscanned.trimStart()[0], Scanner.terminatingChars)
148
- : // if the lookahead is a finalizing token but not >, it's unambiguously a finalizer (currently just ",")
149
- lookahead === ","
139
+ lookahead === ">" ?
140
+ unscanned[0] === "=" ?
141
+ // >== would only occur in an expression like Array<number>==5
142
+ // otherwise, >= would only occur as part of a bound like number>=5
143
+ unscanned[1] === "="
144
+ // if > is the end of a generic instantiation, the next token will be an operator or the end of the string
145
+ : unscanned.trimStart() === "" ||
146
+ isKeyOf(unscanned.trimStart()[0], Scanner.terminatingChars)
147
+ // if the lookahead is a finalizing token but not >, it's unambiguously a finalizer (currently just ",")
148
+ : lookahead === ","
150
149
 
151
150
  export type lookaheadIsFinalizing<
152
151
  lookahead extends string,
153
152
  unscanned extends string
154
- > = lookahead extends ">"
155
- ? unscanned extends `=${infer nextUnscanned}`
156
- ? nextUnscanned extends `=${string}`
157
- ? true
158
- : false
159
- : Scanner.skipWhitespace<unscanned> extends
160
- | ""
161
- | `${TerminatingChar}${string}`
162
- ? true
163
- : false
164
- : lookahead extends ","
165
- ? true
153
+ > =
154
+ lookahead extends ">" ?
155
+ unscanned extends `=${infer nextUnscanned}` ?
156
+ nextUnscanned extends `=${string}` ?
157
+ true
158
+ : false
159
+ : Scanner.skipWhitespace<unscanned> extends (
160
+ "" | `${TerminatingChar}${string}`
161
+ ) ?
162
+ true
163
+ : false
164
+ : lookahead extends "," ? true
166
165
  : false
167
166
 
168
167
  export type shift<
@@ -174,23 +173,25 @@ export namespace Scanner {
174
173
  unscanned extends string,
175
174
  terminator extends string,
176
175
  scanned extends string = ""
177
- > = unscanned extends shift<infer lookahead, infer nextUnscanned>
178
- ? lookahead extends terminator
179
- ? scanned extends `${infer base}${EscapeToken}`
180
- ? shiftUntil<nextUnscanned, terminator, `${base}${lookahead}`>
181
- : [scanned, unscanned]
182
- : shiftUntil<nextUnscanned, terminator, `${scanned}${lookahead}`>
183
- : [scanned, ""]
176
+ > =
177
+ unscanned extends shift<infer lookahead, infer nextUnscanned> ?
178
+ lookahead extends terminator ?
179
+ scanned extends `${infer base}${EscapeToken}` ?
180
+ shiftUntil<nextUnscanned, terminator, `${base}${lookahead}`>
181
+ : [scanned, unscanned]
182
+ : shiftUntil<nextUnscanned, terminator, `${scanned}${lookahead}`>
183
+ : [scanned, ""]
184
184
 
185
185
  export type shiftUntilNot<
186
186
  unscanned extends string,
187
187
  nonTerminator extends string,
188
188
  scanned extends string = ""
189
- > = unscanned extends shift<infer lookahead, infer nextUnscanned>
190
- ? lookahead extends nonTerminator
191
- ? shiftUntilNot<nextUnscanned, nonTerminator, `${scanned}${lookahead}`>
192
- : [scanned, unscanned]
193
- : [scanned, ""]
189
+ > =
190
+ unscanned extends shift<infer lookahead, infer nextUnscanned> ?
191
+ lookahead extends nonTerminator ?
192
+ shiftUntilNot<nextUnscanned, nonTerminator, `${scanned}${lookahead}`>
193
+ : [scanned, unscanned]
194
+ : [scanned, ""]
194
195
 
195
196
  export type shiftUntilNextTerminator<unscanned extends string> = shiftUntil<
196
197
  unscanned,
@@ -1,32 +1,33 @@
1
- import type { TypeNode } from "@arktype/schema"
1
+ import type { RawSchema } from "@arktype/schema"
2
2
  import {
3
+ type ErrorMessage,
3
4
  throwInternalError,
4
- throwParseError,
5
- type ErrorMessage
5
+ throwParseError
6
6
  } from "@arktype/util"
7
- import type { inferAstRoot } from "../semantic/semantic.js"
7
+ import type { inferAstRoot } from "../semantic/infer.js"
8
8
  import type { DynamicState, DynamicStateWithRoot } from "./reduce/dynamic.js"
9
9
  import type { StringifiablePrefixOperator } from "./reduce/shared.js"
10
10
  import type { StaticState, state } from "./reduce/static.js"
11
11
  import type { parseOperand } from "./shift/operand/operand.js"
12
12
  import {
13
- writeUnexpectedCharacterMessage,
14
- type parseOperator
13
+ type parseOperator,
14
+ writeUnexpectedCharacterMessage
15
15
  } from "./shift/operator/operator.js"
16
16
 
17
17
  /**
18
18
  * Try to parse the definition from right to left using the most common syntax.
19
19
  * This can be much more efficient for simple definitions.
20
20
  */
21
- export type parseString<def extends string, $, args> = def extends keyof $
22
- ? // def could also be a generic reference here, in which case it will
23
- // fail semantic validation because it has no args
24
- def
25
- : def extends `${infer child}[]`
26
- ? child extends keyof $
27
- ? [child, "[]"]
28
- : fullStringParse<state.initialize<def>, $, args>
29
- : fullStringParse<state.initialize<def>, $, args>
21
+ export type parseString<def extends string, $, args> =
22
+ def extends keyof $ ?
23
+ // def could also be a generic reference here, in which case it will
24
+ // fail semantic validation because it has no args
25
+ def
26
+ : def extends `${infer child}[]` ?
27
+ child extends keyof $ ?
28
+ [child, "[]"]
29
+ : fullStringParse<state.initialize<def>, $, args>
30
+ : fullStringParse<state.initialize<def>, $, args>
30
31
 
31
32
  export type inferString<def extends string, $, args> = inferAstRoot<
32
33
  parseString<def, $, args>,
@@ -40,7 +41,7 @@ export type BaseCompletions<$, args, otherSuggestions extends string = never> =
40
41
  | StringifiablePrefixOperator
41
42
  | otherSuggestions
42
43
 
43
- export const fullStringParse = (s: DynamicState): TypeNode => {
44
+ export const fullStringParse = (s: DynamicState): RawSchema => {
44
45
  s.parseOperand()
45
46
  const result = parseUntilFinalizer(s).root
46
47
  if (!result) {
@@ -60,31 +61,25 @@ type fullStringParse<s extends StaticState, $, args> = extractFinalizedResult<
60
61
  parseUntilFinalizer<s, $, args>
61
62
  >
62
63
 
63
- export const parseUntilFinalizer = (s: DynamicState) => {
64
- while (s.finalizer === undefined) {
65
- next(s)
66
- }
64
+ export const parseUntilFinalizer = (s: DynamicState): DynamicStateWithRoot => {
65
+ while (s.finalizer === undefined) next(s)
66
+
67
67
  return s as DynamicStateWithRoot
68
68
  }
69
69
 
70
- export type parseUntilFinalizer<
71
- s extends StaticState,
72
- $,
73
- args
74
- > = s["finalizer"] extends undefined
75
- ? parseUntilFinalizer<next<s, $, args>, $, args>
76
- : s
70
+ export type parseUntilFinalizer<s extends StaticState, $, args> =
71
+ s["finalizer"] extends undefined ?
72
+ parseUntilFinalizer<next<s, $, args>, $, args>
73
+ : s
77
74
 
78
75
  const next = (s: DynamicState) =>
79
76
  s.hasRoot() ? s.parseOperator() : s.parseOperand()
80
77
 
81
- type next<s extends StaticState, $, args> = s["root"] extends undefined
82
- ? parseOperand<s, $, args>
83
- : parseOperator<s, $, args>
78
+ type next<s extends StaticState, $, args> =
79
+ s["root"] extends undefined ? parseOperand<s, $, args>
80
+ : parseOperator<s, $, args>
84
81
 
85
82
  export type extractFinalizedResult<s extends StaticState> =
86
- s["finalizer"] extends ErrorMessage
87
- ? s["finalizer"]
88
- : s["finalizer"] extends ""
89
- ? s["root"]
90
- : state.error<writeUnexpectedCharacterMessage<`${s["finalizer"]}`>>
83
+ s["finalizer"] extends ErrorMessage ? s["finalizer"]
84
+ : s["finalizer"] extends "" ? s["root"]
85
+ : state.error<writeUnexpectedCharacterMessage<`${s["finalizer"]}`>>