@xapp/arachne-web-service 1.8.10 → 1.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,7 +25,11 @@ function hasContactInfo(text) {
|
|
|
25
25
|
function extractContacts(text) {
|
|
26
26
|
const emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g;
|
|
27
27
|
const phoneRegex = /\b\d{3}[-.]?\d{3}[-.]?\d{4}\b/g;
|
|
28
|
-
const
|
|
28
|
+
const foundEmails = text.match(emailRegex) || [];
|
|
29
|
+
// remove any emails that end in .png or .jpg, .webp, jpeg, avif, svg, gif
|
|
30
|
+
const filtered = foundEmails.filter(email => !email.match(/\.png$|\.jpg$|\.webp$|\.jpeg$|\.avif$|\.svg$\.bmp$|\.gif$/));
|
|
31
|
+
// and dedupe
|
|
32
|
+
const emails = Array.from(new Set(filtered));
|
|
29
33
|
const phoneNumbers = text.match(phoneRegex) || [];
|
|
30
34
|
return { emails, phoneNumbers };
|
|
31
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractContacts.js","sourceRoot":"","sources":["../../src/utils/extractContacts.ts"],"names":[],"mappings":";AAAA,kCAAkC;;AAQlC,wCASC;AAQD,
|
|
1
|
+
{"version":3,"file":"extractContacts.js","sourceRoot":"","sources":["../../src/utils/extractContacts.ts"],"names":[],"mappings":";AAAA,kCAAkC;;AAQlC,wCASC;AAQD,0CAeC;AArCD;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY;IACvC,uCAAuC;IAEvC,MAAM,iBAAiB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEhD,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,iBAAiB,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnF,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,MAAM,UAAU,GAAG,sDAAsD,CAAC;IAC1E,MAAM,UAAU,GAAG,gCAAgC,CAAC;IAEpD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAEjD,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC,CAAC;IAExH,aAAa;IACb,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE7C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAElD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xapp/arachne-web-service",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.12",
|
|
4
4
|
"types": "lib/index",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@microsoft/api-extractor": "7.47.7",
|
|
18
18
|
"@sparticuz/chromium": "127.0.0",
|
|
19
|
-
"@types/chai": "4.3.
|
|
19
|
+
"@types/chai": "4.3.19",
|
|
20
20
|
"@types/mocha": "10.0.7",
|
|
21
|
-
"@types/node": "20.
|
|
21
|
+
"@types/node": "20.16.5",
|
|
22
22
|
"@types/sinon": "17.0.3",
|
|
23
23
|
"@types/sinon-chai": "3.2.12",
|
|
24
24
|
"@xapp/config": "0.2.3",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@sparticuz/chromium": "127.0.0",
|
|
36
|
-
"@xapp/arachne": "1.8.
|
|
37
|
-
"@xapp/arachne-parsers": "1.8.
|
|
36
|
+
"@xapp/arachne": "1.8.12",
|
|
37
|
+
"@xapp/arachne-parsers": "1.8.12",
|
|
38
38
|
"abort-controller": "3.0.0",
|
|
39
39
|
"gpt-3-encoder": "1.1.4",
|
|
40
40
|
"ico-to-png": "0.2.1",
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"api": "api-extractor run --local",
|
|
52
52
|
"build": "tsc -d true -p .",
|
|
53
53
|
"clean": "rm -rf ./lib/*",
|
|
54
|
+
"test": "mocha --recursive -r ts-node/register \"./src/**/*.test.ts\"",
|
|
54
55
|
"test:f": "mocha --recursive -r ts-node/register \"./src/**/*.ftest.ts\""
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9be0c878e50e02a8530b9d5e6b4ba52c68f9dd43"
|
|
57
58
|
}
|