@fils/sanity-components 0.0.1 → 0.0.3
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/lib/main.d.ts +1 -0
- package/lib/main.js +1 -0
- package/lib/validators/utils.d.ts +2 -0
- package/lib/validators/utils.js +9 -0
- package/package.json +2 -2
package/lib/main.d.ts
CHANGED
package/lib/main.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function urlValidation() {
|
|
2
|
+
return (rule) => rule.custom((url) => {
|
|
3
|
+
if (typeof url === 'undefined') {
|
|
4
|
+
return true; // Allow undefined values
|
|
5
|
+
}
|
|
6
|
+
const regex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/;
|
|
7
|
+
return regex.test(url) ? true : 'Not a valid URL';
|
|
8
|
+
});
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fils/sanity-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Fil's Components for Sanity Back-Ends",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "lib/main.js",
|
|
6
6
|
"repository": "git@github.com:fil-studio/fils.git",
|
|
7
7
|
"author": "Fil Studio <hello@fil.studio>",
|
|
8
8
|
"license": "Apache-2.0",
|