@subql/x-cosmology-ast
v1.4.10
Published
Cosmos TypeScript AST generation
Downloads
969
Readme
@cosmology/ast
Cosmos Typescript ASTs
example usage
import generate from '@babel/generator';
import * as t from '@babel/types';
import { recursiveNamespace } from '@cosmology/ast';
const myModule = recursiveNamespace(
[
'osmosis',
'gamm',
'v1beta',
'pools'
].reverse(), [astBody]);
console.log(generate(t.program(myModule)).code)
produces:
export namespace osmosis {
export namespace gamm {
export namespace v1beta {
export namespace pools {
// astBody here
}
}
}
}