(parser: IObjectParserProp<any>)
| 123 | } |
| 124 | |
| 125 | function parsePlaylistGame(parser: IObjectParserProp<any>): PlaylistGame { |
| 126 | const game: PlaylistGame = { |
| 127 | notes: '', |
| 128 | gameId: '' |
| 129 | }; |
| 130 | parser.prop('id', v => game.gameId = str(v), true); |
| 131 | parser.prop('gameId', v => game.gameId = str(v), true); |
| 132 | parser.prop('notes', v => game.notes = str(v)); |
| 133 | if (!game.gameId) { |
| 134 | throw 'No ID for playlist game'; |
| 135 | } |
| 136 | return game; |
| 137 | } |
no test coverage detected