pema 0.14.0 → 0.14.1
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,5 +1,7 @@
|
|
|
1
1
|
import regex from "#validator/regex";
|
|
2
|
-
|
|
2
|
+
// Choose the first dot after the domain's first character. Keeping dots out
|
|
3
|
+
// of the preceding repetition avoids quadratic backtracking on hostile input.
|
|
4
|
+
const re = /^[^\s@]+@[^\s@][^\s@.]*\.[^\s@]+$/u;
|
|
3
5
|
export default function email(options) {
|
|
4
6
|
return regex(re, options ?? (x => `"${x}" is not a valid email`));
|
|
5
7
|
}
|
package/package.json
CHANGED