@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/chat.cjs
CHANGED
|
@@ -237,10 +237,21 @@ function randomHex(bytes) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
// src/chat/validate.ts
|
|
240
|
+
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])?)+$/;
|
|
240
241
|
function isValidEmail(value) {
|
|
241
242
|
const s = (value || "").trim();
|
|
242
243
|
if (s.length < 6 || s.length > 254) return false;
|
|
243
|
-
|
|
244
|
+
const at = s.lastIndexOf("@");
|
|
245
|
+
if (at < 1) return false;
|
|
246
|
+
const local = s.slice(0, at);
|
|
247
|
+
const domain = s.slice(at + 1);
|
|
248
|
+
if (local.length > 64) return false;
|
|
249
|
+
if (local.startsWith(".") || local.endsWith(".") || local.includes("..")) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
if (domain.includes("..")) return false;
|
|
253
|
+
if (!/\.[a-zA-Z]{2,}$/.test(domain)) return false;
|
|
254
|
+
return EMAIL_RE.test(s);
|
|
244
255
|
}
|
|
245
256
|
|
|
246
257
|
// src/chat/template.ts
|