(ast: A, project: (ast: A) => AST)
| 4801 | } |
| 4802 | |
| 4803 | function projectOwner<A extends AST>(ast: A, project: (ast: A) => AST): A | undefined { |
| 4804 | const owner = getContextOwner(ast) |
| 4805 | if (owner !== ast) { |
| 4806 | const out = project(owner) |
| 4807 | return out === owner && !ast.encoding ? ast : replaceContext(out, ast.context) as A |
| 4808 | } |
| 4809 | } |
| 4810 | |
| 4811 | function projectType<A extends AST>(ast: A): A { |
| 4812 | const owned = projectOwner(ast, stripEncoding) |
no test coverage detected