Fix iterating over non-filtered array
This commit is contained in:
parent
1289913d06
commit
0da43b0411
@ -18,7 +18,7 @@ export class Name {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IYear {
|
export interface IYear {
|
||||||
yeak: number
|
year: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITyped<T> {
|
export interface ITyped<T> {
|
||||||
@ -26,8 +26,9 @@ export interface ITyped<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AorB = 'A' | 'B'
|
type AorB = 'A' | 'B'
|
||||||
|
interface IB { a: number }
|
||||||
/* tslint:disable-next-line */
|
/* tslint:disable-next-line */
|
||||||
type Param<T> = {t: T}
|
type Param<T> = {t: T, b: IB}
|
||||||
|
|
||||||
export class Person {
|
export class Person {
|
||||||
readonly name!: Name
|
readonly name!: Name
|
||||||
|
|||||||
@ -205,6 +205,11 @@ export function typecheck(...argv: string[]) {
|
|||||||
if (typeDefinitions.has(type)) {
|
if (typeDefinitions.has(type)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// if (type.aliasSymbol) {
|
||||||
|
// TODO figure out how to prevent iterating of properties from types
|
||||||
|
// such as strings
|
||||||
|
// return
|
||||||
|
// }
|
||||||
const typeParameters: ts.TypeParameter[] = []
|
const typeParameters: ts.TypeParameter[] = []
|
||||||
const expandedTypeParameters: ts.Type[] = []
|
const expandedTypeParameters: ts.Type[] = []
|
||||||
const allRelevantTypes: ts.Type[] = []
|
const allRelevantTypes: ts.Type[] = []
|
||||||
@ -278,19 +283,19 @@ export function typecheck(...argv: string[]) {
|
|||||||
console.log(`interface ${classDef.name} {`)
|
console.log(`interface ${classDef.name} {`)
|
||||||
console.log(' ',
|
console.log(' ',
|
||||||
classDef.properties
|
classDef.properties
|
||||||
.map(p => p.name + ': ' + typeToString(p.type)) // + ' {' +
|
.map(p => p.name + ': ' + typeToString(p.type) + ' {' +
|
||||||
// p.relevantTypes.map(typeToString) + '}')
|
p.relevantTypes.map(typeToString) + '}')
|
||||||
.join('\n '),
|
.join('\n '),
|
||||||
)
|
)
|
||||||
console.log('}')
|
console.log('}')
|
||||||
// console.log('\n allRelevantTypes:\n ',
|
console.log('\n allRelevantTypes:\n ',
|
||||||
// classDef.allRelevantTypes.map(typeToString).join('\n '))
|
classDef.allRelevantTypes.map(typeToString).join('\n '))
|
||||||
console.log('\n')
|
console.log('\n')
|
||||||
|
|
||||||
classDefs.push(classDef)
|
classDefs.push(classDef)
|
||||||
typeDefinitions.set(type, classDef)
|
typeDefinitions.set(type, classDef)
|
||||||
|
|
||||||
allRelevantTypes.map(handleType)
|
classDef.allRelevantTypes.forEach(handleType)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user