TypeScript/tests/cases/conformance/externalModules/commonJsImportBindingElementNarrowType.ts
Armando Aguirre 8f8a579eee
Added BindingElement to isSomeImportDeclaration (#43387)
* Added BindingElement to isSomeImportDeclaration

* Added tests

* Refactores to use getDeclarationOfAlias
2021-03-31 18:18:16 -07:00

15 lines
264 B
TypeScript

// Regresion test for GH#41957
// @allowJs: true
// @checkJs: true
// @strictNullChecks: true
// @noEmit: true
// @Filename: /foo.d.ts
export const a: number | null;
// @Filename: /bar.js
const { a } = require("./foo");
if (a) {
var x = a + 1;
}