@social-mail/social-mail-web-server 1.5.67 → 1.5.69

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.
@@ -1,4 +1,4 @@
1
1
  export default class ApexDomain {
2
- static getApexDomain(host: string): any;
2
+ static getApexDomain(host: string, replace?: boolean): any;
3
3
  }
4
4
  //# sourceMappingURL=ApexDomain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApexDomain.d.ts","sourceRoot":"","sources":["../../src/common/ApexDomain.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,UAAU;IAE3B,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM;CAYpC"}
1
+ {"version":3,"file":"ApexDomain.d.ts","sourceRoot":"","sources":["../../src/common/ApexDomain.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,UAAU;IAE3B,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAO;CAiBpD"}
@@ -1,15 +1,21 @@
1
1
  import { parse_host } from "tld-extract";
2
2
  export default class ApexDomain {
3
- static getApexDomain(host) {
4
- host = host.toLocaleLowerCase();
5
- if (/((^localhost)|(\.localhost))$/.test(host)) {
6
- return;
3
+ static getApexDomain(host, replace = true) {
4
+ try {
5
+ host = host.toLocaleLowerCase();
6
+ if (/((^localhost)|(\.localhost))$/.test(host)) {
7
+ return null;
8
+ }
9
+ if (/^\d+\.\d+\.\d+\.\d+$/.test(host)) {
10
+ return null;
11
+ }
12
+ const { tld, domain, sub } = parse_host(host);
13
+ return domain;
7
14
  }
8
- if (/^\d+\.\d+\.\d+\.\d+$/.test(host)) {
9
- return;
15
+ catch (error) {
16
+ console.error(`Failed to get apex domain for ${host}`);
17
+ return null;
10
18
  }
11
- const { tld, domain, sub } = parse_host(host);
12
- return domain;
13
19
  }
14
20
  }
15
21
  //# sourceMappingURL=ApexDomain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApexDomain.js","sourceRoot":"","sources":["../../src/common/ApexDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,UAAU;IAE3B,MAAM,CAAC,aAAa,CAAC,IAAY;QAC7B,IAAI,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAChC,IAAI,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,OAAO;QACX,CAAC;QACD,IAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,OAAO;QACX,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ"}
1
+ {"version":3,"file":"ApexDomain.js","sourceRoot":"","sources":["../../src/common/ApexDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC,OAAO,OAAO,UAAU;IAE3B,MAAM,CAAC,aAAa,CAAC,IAAY,EAAE,OAAO,GAAG,IAAI;QAC7C,IAAI,CAAC;YACD,IAAI,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAChC,IAAI,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,IAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAI,UAAU,CAAC,IAAI,CAAC,CAAC;YAC/C,OAAO,MAAM,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;CAEJ"}