typescript version update; nicer fix of possible typescript error

This commit is contained in:
Kononnable 2017-05-29 16:35:10 +02:00
parent 642e57bf74
commit 06158a50ec
2 changed files with 2 additions and 3 deletions

View File

@ -26,7 +26,7 @@
"mssql": "^3.3.0",
"reflect-metadata": "^0.1.10",
"typeorm": "0.0.10",
"typescript": "^2.3.2",
"typescript": "^2.3.3",
"yargs": "^7.0.2"
},
"devDependencies": {

View File

@ -15,9 +15,8 @@ export class MssqlDriver extends AbstractDriver {
console.error(`Table ${entity.EntityName} has no PK.`)
return;
}
let pIndex = primaryIndex //typescript error? pIndex:IndexInfo; primaryIndex:IndexInfo|undefined
entity.Columns.forEach(col => {
if (pIndex.columns.some(cIndex => cIndex.name == col.name)) col.isPrimary = true
if (primaryIndex!.columns.some(cIndex => cIndex.name == col.name)) col.isPrimary = true
})
});
}