Skip to content

Commit

Permalink
blockString-fuzz: improve lexValue typing (#2966)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Mar 13, 2021
1 parent afffdfe commit 8109e42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/language/__tests__/blockString-fuzz.js
Expand Up @@ -10,10 +10,11 @@ import { Lexer } from '../lexer';
import { Source } from '../source';
import { printBlockString } from '../blockString';

function lexValue(str: string) {
function lexValue(str: string): string {
const lexer = new Lexer(new Source(str));
const value = lexer.advance().value;

invariant(typeof value === 'string');
invariant(lexer.advance().kind === '<EOF>', 'Expected EOF');
return value;
}
Expand Down

0 comments on commit 8109e42

Please sign in to comment.