* Returns a JSON representation of this token. * @returns The JSON-serializable representation. * @example * ```ts * import { Lexer, Source } from 'graphql/language'; * * const lexer = new Lexer(new Source('{ hello }')); * const token = lexer.advance().toJSON(); * * token;
()
| 175 | * ``` |
| 176 | */ |
| 177 | toJSON(): { |
| 178 | kind: TokenKind; |
| 179 | value?: string; |
| 180 | line: number; |
| 181 | column: number; |
| 182 | } { |
| 183 | return { |
| 184 | kind: this.kind, |
| 185 | value: this.value, |
| 186 | line: this.line, |
| 187 | column: this.column, |
| 188 | }; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | /** The list of all possible AST node types. */ |
no outgoing calls
no test coverage detected