( base: mutableInnerOfKind<"sequence">, element: BaseRoot )
| 113 | : never |
| 114 | |
| 115 | const appendRequiredElement = ( |
| 116 | base: mutableInnerOfKind<"sequence">, |
| 117 | element: BaseRoot |
| 118 | ): mutableInnerOfKind<"sequence"> => { |
| 119 | if (base.defaultables || base.optionals) { |
| 120 | return throwParseError( |
| 121 | base.variadic ? |
| 122 | // e.g. [boolean = true, ...string[], number] |
| 123 | postfixAfterOptionalOrDefaultableMessage |
| 124 | // e.g. [string?, number] |
| 125 | : requiredPostOptionalMessage |
| 126 | ) |
| 127 | } |
| 128 | if (base.variadic) { |
| 129 | // e.g. [...string[], number] |
| 130 | base.postfix = append(base.postfix, element) |
| 131 | } else { |
| 132 | // e.g. [string, number] |
| 133 | base.prefix = append(base.prefix, element) |
| 134 | } |
| 135 | return base |
| 136 | } |
| 137 | |
| 138 | const appendOptionalElement = ( |
| 139 | base: mutableInnerOfKind<"sequence">, |
no test coverage detected