From 18cd6ae6b76a1baa0fe2dda5d3f21448c4aedbd5 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 24 Jan 2024 22:15:20 +0100 Subject: [PATCH] code golf --- src/pgn.test.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/pgn.test.ts b/src/pgn.test.ts index b7930cea..bc6f6280 100644 --- a/src/pgn.test.ts +++ b/src/pgn.test.ts @@ -82,12 +82,8 @@ test('make pgn', () => { }); test('extend mainline', () => { - let game: Game = defaultGame(emptyHeaders); - const mainline = 'e4 d5 a3 h6 Bg5'.split(' ').map(san => { - return { - san: san, - }; - }); + const game: Game = defaultGame(emptyHeaders); + const mainline = 'e4 d5 a3 h6 Bg5'.split(' ').map(san => ({ san })); extendMainline(game, mainline); expect(makePgn(game)).toEqual('1. e4 d5 2. a3 h6 3. Bg5 *\n'); });