refactor: replace re2 with re2-wasm (#12998)

* refactor: replace re2 with re2-wasm

* refactor: remove migrated routes

* ci: remove foresight

https://github.com/runforesight
Foresight is no longer in service

* fix: add back removed wasm

chore: bump base OS image
This commit is contained in:
Tony
2023-08-12 00:34:28 +08:00
committed by GitHub
parent fa27a275d9
commit 79eae1eb45
7 changed files with 60 additions and 1726 deletions

View File

@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
const { simplecc } = require('simplecc-wasm');
const got = require('@/utils/got');
const config = require('@/config').value;
const RE2 = require('re2');
const { RE2 } = require('re2-wasm');
let mercury_parser;
@@ -167,7 +167,7 @@ module.exports = async (ctx, next) => {
case 'regexp':
return new RegExp(string, 'i');
case 're2':
return new RE2(string, 'i');
return new RE2(string, 'iu');
default:
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
}
@@ -176,7 +176,7 @@ module.exports = async (ctx, next) => {
case 'regexp':
return new RegExp(string);
case 're2':
return new RE2(string);
return new RE2(string, 'u');
default:
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
}