@refractedlabs/ast
v1.4.1-rc23
Published
Cosmos TypeScript AST generation
Downloads
13
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
}
}
}
}