-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: replace p-queue with evan/concurrency (#143)
* perf: replace p-queue with evan/concurrency * refactor: unify queue error handling
- Loading branch information
Showing
7 changed files
with
239 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import consola from 'consola'; | ||
|
||
const errs: string[] = []; | ||
|
||
export const LOOP_LIMIT = 5; | ||
|
||
export const addError = (error: string) => { | ||
errs.push(error); | ||
}; | ||
|
||
export const checkErrors = (limit = 0) => { | ||
if (errs.length > limit) { | ||
for (const err of errs) { | ||
consola.error(err); | ||
} | ||
|
||
if (limit > 0) { | ||
throw new Error('Too many errors occurred during parsing. Stopping...'); | ||
} | ||
|
||
throw new Error('Some fonts experienced errors during parsing.'); | ||
} | ||
}; |
Oops, something went wrong.