mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
479 B
TypeScript
23 lines
479 B
TypeScript
//// [tests/cases/conformance/controlFlow/controlFlowWithTemplateLiterals.ts] ////
|
|
|
|
//// [controlFlowWithTemplateLiterals.ts]
|
|
declare const envVar: string | undefined;
|
|
if (typeof envVar === `string`) {
|
|
envVar.slice(0)
|
|
}
|
|
|
|
declare const obj: {test: string} | {}
|
|
if (`test` in obj) {
|
|
obj.test.slice(0)
|
|
}
|
|
|
|
|
|
//// [controlFlowWithTemplateLiterals.js]
|
|
"use strict";
|
|
if (typeof envVar === `string`) {
|
|
envVar.slice(0);
|
|
}
|
|
if (`test` in obj) {
|
|
obj.test.slice(0);
|
|
}
|