You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import fs from "fs" ;
const path = "src/services/parse/instruction-lexicon.ts" ;
let src = fs . readFileSync ( path , "utf8" ) ;
const re =
/\/\/ date[\s\S]*?!BODY_ACTION_RE\.test\(bodyOnly\)\s*\n\s*\) \{\s*\n\s*return true;\s*\n\s*\}/ ;
if ( ! re . test ( src ) ) {
// try alternate
const idx = src . indexOf ( "date / QQ" ) ;
console . log ( "snippet" , JSON . stringify ( src . slice ( idx , idx + 280 ) ) ) ;
throw new Error ( "block not found" ) ;
}
src = src . replace (
re ,
` // date middle-forward: no Dear = shell (subject may contain \ u62c6 \ u67dc/ \ u62e6 \ u622a noise)
if (
/date@usasinogroup \\ .com/i.test(compact) &&
/ \ u5bc4 \ u4ef6 \ u4eba| \ u4e3b \ u65e8/.test(compact) &&
!/Dear[,, ]/.test(compact)
) {
return true;
} ` ,
) ;
fs . writeFileSync ( path , src ) ;
console . log ( "date shell rule updated" ) ;