confusablematcher-js-interop
Version:
TypeScript NAPI Interop for ConfusableMatcher.
13 lines (11 loc) • 393 B
JavaScript
const { parentPort } = require('worker_threads');
const { ConfusableMatcher } = require('../../../build/src');
const matcher = new ConfusableMatcher([], [], true);
let completed = 0;
while (true) {
matcher.indexOfSync('SIMP', 'SIMP', { matchOnWordBoundary: true, matchRepeating: true });
if (++completed > 10000) {
completed = 0;
parentPort.postMessage(null);
}
}