Add support for aliases
parent
492a9e9af8
commit
b836d2ef8c
|
@ -7,7 +7,12 @@ const {partition, log} = require('./utils');
|
|||
|
||||
const extractors = {
|
||||
* TypeAlias(node) {
|
||||
const schema = yield node.right;
|
||||
let schema = yield node.right;
|
||||
|
||||
if (typeof schema === 'string') {
|
||||
schema = {type: schema};
|
||||
}
|
||||
|
||||
schema.name = yield node.id;
|
||||
|
||||
yield provide(schema);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type A = {};
|
||||
type A = string;
|
||||
|
||||
type Type = {
|
||||
a: A,
|
||||
|
@ -21,9 +21,8 @@ class Class {
|
|||
// ###
|
||||
({
|
||||
A: {
|
||||
type: 'record',
|
||||
type: 'string',
|
||||
name: 'A',
|
||||
fields: [],
|
||||
},
|
||||
Type: {
|
||||
type: 'record',
|
||||
|
|
Loading…
Reference in New Issue