@inzombieland/nuxt-common 1.18.25 → 1.18.27

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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.25",
3
+ "version": "1.18.27",
4
4
  "configKey": "nuxt-common",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.6.0",
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
2
2
  import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
3
3
 
4
4
  const name = "@inzombieland/nuxt-common";
5
- const version = "1.18.25";
5
+ const version = "1.18.27";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -6,4 +6,5 @@ export { useCookies } from "./use-cookies";
6
6
  export { useSubscribe } from "./use-subscribe";
7
7
  export { useThemeMode } from "./use-theme-mode";
8
8
  export { useUser } from "./use-user";
9
+ export { useValidators } from "./use-validators";
9
10
  export { useVisitor } from "./use-visitor";
@@ -6,4 +6,5 @@ export { useCookies } from "./use-cookies.mjs";
6
6
  export { useSubscribe } from "./use-subscribe.mjs";
7
7
  export { useThemeMode } from "./use-theme-mode.mjs";
8
8
  export { useUser } from "./use-user.mjs";
9
+ export { useValidators } from "./use-validators.mjs";
9
10
  export { useVisitor } from "./use-visitor.mjs";
@@ -1,8 +1,6 @@
1
1
  export declare const useValidators: () => {
2
2
  emailValidator: (value: string) => boolean;
3
- phoneValidator: (value: string) => boolean;
4
- phoneOrEmailValidator: (value: string) => boolean;
3
+ passwordValidator: (value: string) => boolean;
5
4
  minLengthValidator: (minLength: number) => (value: string) => boolean;
6
5
  maxLengthValidator: (maxLength: number) => (value: string) => boolean;
7
- passwordValidator: (value: string) => boolean;
8
6
  };
@@ -0,0 +1,10 @@
1
+ const EMAIL_REGEXP = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/i;
2
+ const PASSWORD_REGEXP = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[\w!@#$%^&*()+\-=[\]{};':"\\|,.<>/?]{8,}$/;
3
+ export const useValidators = () => {
4
+ return {
5
+ emailValidator: (value) => EMAIL_REGEXP.test(value.toLowerCase()),
6
+ passwordValidator: (value) => PASSWORD_REGEXP.test(value),
7
+ minLengthValidator: (minLength) => (value) => value.length >= minLength,
8
+ maxLengthValidator: (maxLength) => (value) => value.length <= maxLength
9
+ };
10
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.25",
3
+ "version": "1.18.27",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
@@ -21,6 +21,7 @@
21
21
  "ohash": "^2.0.11",
22
22
  "rxjs": "^7.8.2",
23
23
  "vant": "^4.9.19",
24
+ "vue3-otp-input": "^0.5.21",
24
25
  "zod": "^3.24.2"
25
26
  }
26
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.25",
3
+ "version": "1.18.27",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,17 +0,0 @@
1
- const EMAIL_REGEXP = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/i;
2
- const PHONE1_REGEXP = /^((?:\+7|8|7)?(\d){10})$/gm;
3
- const PHONE2_REGEXP = /^((?:\+7|8|7|\+7-|8-|7-)?(\d){3}-(\d){3}-(\d){2}-(\d){2})$/gm;
4
- const PHONE3_REGEXP = /^((?:\+7|8|7|\+7\s|8\s|7\s)?\((\d){3}\)\s?(\d){3}[-\s](\d){2}[-\s](\d){2})$/gm;
5
- const PASSWORD_REGEXP = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[\w!@#$%^&*()+\-=[\]{};':"\\|,.<>/?]{8,}$/;
6
- const emailValidator = (value) => EMAIL_REGEXP.test(value.toLowerCase());
7
- const phoneValidator = (value) => PHONE1_REGEXP.test(value) || PHONE2_REGEXP.test(value) || PHONE3_REGEXP.test(value);
8
- export const useValidators = () => {
9
- return {
10
- emailValidator,
11
- phoneValidator,
12
- phoneOrEmailValidator: (value) => phoneValidator(value) || emailValidator(value),
13
- minLengthValidator: (minLength) => (value) => value.length >= minLength,
14
- maxLengthValidator: (maxLength) => (value) => value.length <= maxLength,
15
- passwordValidator: (value) => PASSWORD_REGEXP.test(value)
16
- };
17
- };