File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import { getSection } from "../wikipedia";
2222import * as WeakSpot from "../weak-spot" ;
2323import * as IPAddresses from "../../utils/ip-addresses" ;
2424import * as TestState from "../test-state" ;
25- import { WordGenError } from "../words-generator " ;
25+ import { WordGenError } from "../../utils/word-gen-error " ;
2626
2727export type FunboxFunctions = {
2828 getWord ?: ( wordset ?: Wordset , wordIndex ?: number ) => string ;
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ import {
7373import { getFunboxesFromString } from "@monkeytype/funbox" ;
7474import * as CompositionState from "../states/composition" ;
7575import { SnapshotResult } from "../constants/default-snapshot" ;
76+ import { WordGenError } from "../utils/word-gen-error" ;
7677
7778let failReason = "" ;
7879const koInputVisual = document . getElementById ( "koInputVisual" ) as HTMLElement ;
@@ -469,7 +470,7 @@ export async function init(): Promise<void> {
469470 wordsHaveNewline = gen . hasNewline ;
470471 } catch ( e ) {
471472 console . error ( e ) ;
472- if ( e instanceof WordsGenerator . WordGenError ) {
473+ if ( e instanceof WordGenError ) {
473474 if ( e . message . length > 0 ) {
474475 Notifications . add ( e . message , 0 , {
475476 important : true ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 getActiveFunboxesWithFunction ,
2323 isFunboxActiveWithFunction ,
2424} from "./funbox/list" ;
25+ import { WordGenError } from "../utils/word-gen-error" ;
2526
2627function shouldCapitalize ( lastChar : string ) : boolean {
2728 return / [ ? ! . ؟ ] / . test ( lastChar ) ;
@@ -475,13 +476,6 @@ export function getLimit(): number {
475476 return limit ;
476477}
477478
478- export class WordGenError extends Error {
479- constructor ( message : string ) {
480- super ( message ) ;
481- this . name = "WordGenError" ;
482- }
483- }
484-
485479async function getQuoteWordList (
486480 language : LanguageObject ,
487481 wordOrder ?: FunboxWordOrder
Original file line number Diff line number Diff line change 1+ export class WordGenError extends Error {
2+ constructor ( message : string ) {
3+ super ( message ) ;
4+ this . name = "WordGenError" ;
5+ }
6+ }
You can’t perform that action at this time.
0 commit comments