Skip to content

Commit ae3d8b4

Browse files
authored
Typescripts namespace styling change (#289)
* merge conflict * format-document * Changes to getmainnamesace method * Splitting lines to use if else, stacking switch case labels * Using nullable check
1 parent 6e9b342 commit ae3d8b4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/GraphODataTemplateWriter/CodeHelpers/TypeScript/TypeScriptNamespace.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ public class TypeScriptNamespace
4545
/// <returns></returns>
4646
public string GetMainNamespace()
4747
{
48-
return TypeScriptMainNamespaceNamePrefix + (ConfigurationService.Settings.Properties != null && ConfigurationService.Settings.Properties.ContainsKey("typescript.namespacePostfix") ? ConfigurationService.Settings.Properties["typescript.namespacePostfix"] : string.Empty);
48+
if (ConfigurationService.Settings.Properties?.ContainsKey("typescript.namespacePostfix") == true)
49+
{
50+
51+
return TypeScriptMainNamespaceNamePrefix + ConfigurationService.Settings.Properties["typescript.namespacePostfix"];
52+
}
53+
54+
return TypeScriptMainNamespaceNamePrefix;
4955
}
5056

5157
/// <summary>

test/Typewriter.Test/MultipleNamespacesTestRunner.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,10 @@ string getMetadataFile(TestLanguage testLanguage)
3838
switch (testLanguage)
3939
{
4040
case TestLanguage.CSharp:
41-
return MetadataMultipleNamespacesFile;
4241
case TestLanguage.Java:
4342
return MetadataMultipleNamespacesFile;
4443
case TestLanguage.TypeScript:
45-
return MetadataWithSubNamespacesFile;
4644
case TestLanguage.PHP:
47-
return MetadataWithSubNamespacesFile;
4845
case TestLanguage.ObjC:
4946
return MetadataWithSubNamespacesFile;
5047
default:

0 commit comments

Comments
 (0)