-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
typescript version: Version 1.9.0-dev.20160424
first looks like a bug:
if (options.leftJoin)
Object.keys(options.leftJoin).forEach(key => {
qb.leftJoin(options.leftJoin[key], key);
});
Gives TS2531: Object is possibly 'null' or 'undefined'., however error is not expected because of the if (options.leftJoin)
check above.
second:
connect(options?: ConnectionOptions) {
if (!options)
options = {} as ConnectionOptions;
console.log(options.url);
}
Gives same TS2531: Object is possibly 'null' or 'undefined'.. Looks like expected behaviour because of original type of the options object. Solution is to define variable with a new type and without undefined. Maybe there is a smarter way to do it?
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue