mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
refactor: rename paths
This commit is contained in:
1 parent
e5f5590a67
commit
b5e20766a3
12 files changed
+52
-52
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { Matcher } from './Matcher.js'
|
||||
import { Command } from '../types.js'
|
||||
|
||||
export class ErrorMatcher implements Matcher {
|
||||
private matcher?: RegExp
|
||||
constructor(errorPattern?: string) {
|
||||
if (errorPattern) {
|
||||
this.matcher = new RegExp(errorPattern)
|
||||
}
|
||||
}
|
||||
|
||||
match(command: Command): boolean {
|
||||
if (!this.matcher) {
|
||||
return !command.error
|
||||
}
|
||||
return this.matcher.test(command.error || '')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user