vuesp-components 2.1.9 → 2.2.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.
@@ -0,0 +1,2 @@
1
+ export * from './validate';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ const s = (n) => /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(n), o = (n, t) => t && t.length >= n, i = (n, t) => t && t.length <= n, l = (n, t) => t && +t >= n, c = (n, t) => t && +t <= n, m = (n) => n && n instanceof Date && !isNaN(n.valueOf()) || "Invalid Date", u = (n) => typeof n == "number" && !isNaN(n) || "Value is a number", d = (n) => !!(n && n.length) || "Required", r = (n, t = "Field do not match") => (e, a = {}) => e === a[n] || t, h = (n) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n) || "Invalid Email", g = (n) => (t) => o(n, t) || `Min length ${n}`, x = (n) => (t) => i(n, t) || `Max length ${n}`, N = (n) => (t) => l(n, t) || `Min value ${n}`, p = (n) => (t) => c(n, t) || `Max value ${n}`, $ = (n) => s(n) || "Invalid ip address", I = (n) => typeof +n == "number" && !isNaN(+n) && +n < 65536 || "Invalid port";
2
+ export {
3
+ $ as ip,
4
+ m as isDate,
5
+ h as isEmail,
6
+ u as isNumber,
7
+ I as isPort,
8
+ x as maxLen,
9
+ p as maxVal,
10
+ g as minLen,
11
+ N as minVal,
12
+ d as required,
13
+ r as sameAs,
14
+ s as validateIP
15
+ };
@@ -0,0 +1,13 @@
1
+ export declare const validateIP: (ip: string) => boolean;
2
+ export declare const isDate: (v: unknown) => {};
3
+ export declare const isNumber: (v: string) => true | "Value is a number";
4
+ export declare const required: (v: string) => true | "Required";
5
+ export declare const sameAs: (name: string, m?: string) => (v: string, vals?: Record<string, unknown>) => string | true;
6
+ export declare const isEmail: (v: string) => true | "Invalid Email";
7
+ export declare const minLen: (i: number) => (v: string) => true | `Min length ${number}`;
8
+ export declare const maxLen: (i: number) => (v: string) => true | `Max length ${number}`;
9
+ export declare const minVal: (i: number) => (v: string) => true | `Min value ${number}`;
10
+ export declare const maxVal: (i: number) => (v: string) => true | `Max value ${number}`;
11
+ export declare const ip: (v: string) => true | "Invalid ip address";
12
+ export declare const isPort: (v: string) => true | "Invalid port";
13
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate/validate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,YACwI,CAAC;AAO9K,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,OAAsE,CAAC;AACxG,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,+BAAgE,CAAC;AACnG,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,sBAAyC,CAAC;AAC5E,eAAO,MAAM,MAAM,GAChB,MAAM,MAAM,EAAE,UAAwB,MACtC,GAAG,MAAM,EAAE,OAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,kBACvB,CAAC;AAE1B,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,2BAA4D,CAAC;AAC9F,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,MAAM,GAAG,MAAM,kCAAyC,CAAC;AACzF,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,MAAM,GAAG,MAAM,kCAAyC,CAAC;AACzF,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,MAAM,GAAG,MAAM,iCAAuC,CAAC;AACvF,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,MAAM,GAAG,MAAM,iCAAuC,CAAC;AAEvF,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,gCAA0C,CAAC;AACvE,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,0BAA2E,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.9",
2
+ "version": "2.2.0",
3
3
  "name": "vuesp-components",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
@@ -31,6 +31,11 @@
31
31
  "import": "./dist/helpers/index.es.js",
32
32
  "default": "./dist/helpers/index.es.js"
33
33
  },
34
+ "./validate": {
35
+ "types": "./dist/validate/index.d.ts",
36
+ "import": "./dist/validate/index.es.js",
37
+ "default": "./dist/validate/index.es.js"
38
+ },
34
39
  "./types": {
35
40
  "types": "./dist/types/index.d.ts"
36
41
  },