Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(patterns, recorder) {
this.onigScanner = new oniguruma.OnigScanner(patterns);
this.regexps = patterns.map(
pattern => new oniguruma.OnigRegExp(pattern)
);
this.patterns = patterns;
this.recorder = recorder;
}
/**
createScanner (firstLine, position, anchorPosition) {
const patterns = this.patterns.map(pattern => pattern.getRegex(firstLine, position, anchorPosition))
return new OnigScanner(patterns)
}