@amimpact/willy-utils 4.8.2 → 4.9.0
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/package.json +1 -1
- package/src/index.ts +9 -1
- package/src/url.ts +10 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -24,7 +24,14 @@ import {
|
|
|
24
24
|
wrap,
|
|
25
25
|
} from './misc';
|
|
26
26
|
import { $, $$, getParents } from './selectors';
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
isCraftActionUrl,
|
|
29
|
+
isInternalLink,
|
|
30
|
+
isExternalUrl,
|
|
31
|
+
isAsset,
|
|
32
|
+
slugify,
|
|
33
|
+
isValidEmail,
|
|
34
|
+
} from './url';
|
|
28
35
|
|
|
29
36
|
export {
|
|
30
37
|
$,
|
|
@@ -53,6 +60,7 @@ export {
|
|
|
53
60
|
isPlainObject,
|
|
54
61
|
isTouchDevice,
|
|
55
62
|
isValidUrl,
|
|
63
|
+
isValidEmail,
|
|
56
64
|
observeResize,
|
|
57
65
|
parseISODuration,
|
|
58
66
|
readCookie,
|
package/src/url.ts
CHANGED
|
@@ -139,3 +139,13 @@ export const slugify = (str: string) => {
|
|
|
139
139
|
.replace(/[\s_-]+/g, '-')
|
|
140
140
|
.replace(/^-+|-+$/g, '');
|
|
141
141
|
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Check op geldig email adres
|
|
145
|
+
* @param {string} email
|
|
146
|
+
*/
|
|
147
|
+
export const isValidEmail = (email: string) => {
|
|
148
|
+
// Reguliere expressie voor een eenvoudig e-mailformaat
|
|
149
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
150
|
+
return emailRegex.test(email);
|
|
151
|
+
};
|