@getnexorai/sdk 0.1.3 → 0.1.5
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.
- package/dist/chat.cjs +12 -1
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/{chunk-WUUXZIQN.js → chunk-EGZR7CCR.js} +14 -3
- package/dist/chunk-EGZR7CCR.js.map +1 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/nexor.iife.js +8 -8
- package/dist/nexor.iife.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-WUUXZIQN.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -676,10 +676,21 @@ function randomHex(bytes) {
|
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
// src/chat/validate.ts
|
|
679
|
+
var EMAIL_RE = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;
|
|
679
680
|
function isValidEmail(value) {
|
|
680
681
|
const s = (value || "").trim();
|
|
681
682
|
if (s.length < 6 || s.length > 254) return false;
|
|
682
|
-
|
|
683
|
+
const at = s.lastIndexOf("@");
|
|
684
|
+
if (at < 1) return false;
|
|
685
|
+
const local = s.slice(0, at);
|
|
686
|
+
const domain = s.slice(at + 1);
|
|
687
|
+
if (local.length > 64) return false;
|
|
688
|
+
if (local.startsWith(".") || local.endsWith(".") || local.includes("..")) {
|
|
689
|
+
return false;
|
|
690
|
+
}
|
|
691
|
+
if (domain.includes("..")) return false;
|
|
692
|
+
if (!/\.[a-zA-Z]{2,}$/.test(domain)) return false;
|
|
693
|
+
return EMAIL_RE.test(s);
|
|
683
694
|
}
|
|
684
695
|
|
|
685
696
|
// src/chat/template.ts
|