(ast: AST)
| 2239 | |
| 2240 | /** @internal */ |
| 2241 | export const getNumberIndexedAccess = (ast: AST): AST => { |
| 2242 | switch (ast._tag) { |
| 2243 | case "TupleType": { |
| 2244 | let hasOptional = false |
| 2245 | let out: Array<AST> = [] |
| 2246 | for (const e of ast.elements) { |
| 2247 | if (e.isOptional) { |
| 2248 | hasOptional = true |
| 2249 | } |
| 2250 | out.push(e.type) |
| 2251 | } |
| 2252 | if (hasOptional) { |
| 2253 | out.push(undefinedKeyword) |
| 2254 | } |
| 2255 | out = out.concat(getRestASTs(ast.rest)) |
| 2256 | return Union.make(out) |
| 2257 | } |
| 2258 | case "Refinement": |
| 2259 | return getNumberIndexedAccess(ast.from) |
| 2260 | case "Union": |
| 2261 | return Union.make(ast.types.map(getNumberIndexedAccess)) |
| 2262 | case "Suspend": |
| 2263 | return getNumberIndexedAccess(ast.f()) |
| 2264 | } |
| 2265 | throw new Error(errors_.getASTUnsupportedSchemaErrorMessage(ast)) |
| 2266 | } |
| 2267 | |
| 2268 | const getTypeLiteralPropertySignature = (ast: TypeLiteral, name: PropertyKey): PropertySignature | undefined => { |
| 2269 | // from property signatures... |
nothing calls this directly
no test coverage detected