Skip to content

Commit 799c830

Browse files
committed
Add toJSON method to WordImpl
1 parent 0b0ed9d commit 799c830

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/word.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ export class WordImpl implements Word {
6464
set parts(v: WordPart[] | undefined) {
6565
this.#parts = v ?? undefined;
6666
}
67+
68+
toJSON() {
69+
return { text: this.text, pos: this.pos, end: this.end, parts: this.parts, value: this.value };
70+
}
6771
}

0 commit comments

Comments
 (0)