Skip to content

Commit fe50c00

Browse files
committed
bug
1 parent c721122 commit fe50c00

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/LazyCoder.Runner/Writer/TsFileWriter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Linq;
12
using LazyCoder.Typescript;
23

34
namespace LazyCoder.Runner.Writer
@@ -12,7 +13,8 @@ public void Write(IKeyboard keyboard,
1213
keyboard.Write(tsImport);
1314
}
1415

15-
keyboard.NewLine();
16+
if (tsFile.Imports.Any())
17+
keyboard.NewLine();
1618

1719
foreach (var tsDeclaration in tsFile.Declarations)
1820
{

src/LazyCoder.Runner/Writer/WriterContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public IKeyboard Indent()
5858

5959
public string GetResult()
6060
{
61-
return sb.ToString().Trim();
61+
return sb.ToString();
6262
}
6363
}
6464
}

tests/LazyCoder.Tests/TestExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static void ShouldBeTranslatedTo<T>(this T tsThing, params string[] lines
88
{
99
var writerContext = new WriterContext();
1010
writerContext.Write(tsThing);
11-
var result = writerContext.GetResult();
11+
var result = writerContext.GetResult().Trim();
1212
result.ShouldBeLines(lines);
1313
}
1414
}

0 commit comments

Comments
 (0)