@jdsalasc/solvejs-validators 1.0.2

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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @jdsalasc/solvejs-validators
2
+
3
+ Validation helpers for common web and app form pain points.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @jdsalasc/solvejs-validators
9
+ ```
10
+
11
+ ## Example
12
+
13
+ ```ts
14
+ import { isCellphoneNumber, isAddressDirection, isValidName } from "@jdsalasc/solvejs-validators";
15
+
16
+ isCellphoneNumber("+573001112233");
17
+ isAddressDirection("NORTH");
18
+ isValidName("Maria Fernanda");
19
+ ```
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCellphoneNumber = isCellphoneNumber;
4
+ exports.isAddressDirection = isAddressDirection;
5
+ exports.isValidName = isValidName;
6
+ exports.isEmail = isEmail;
7
+ exports.isHttpUrl = isHttpUrl;
8
+ exports.isPostalCode = isPostalCode;
9
+ exports.isStrongPassword = isStrongPassword;
10
+ const ADDRESS_DIRECTIONS = new Set([
11
+ "N",
12
+ "S",
13
+ "E",
14
+ "W",
15
+ "NE",
16
+ "NW",
17
+ "SE",
18
+ "SW",
19
+ "NORTH",
20
+ "SOUTH",
21
+ "EAST",
22
+ "WEST",
23
+ "NORTHEAST",
24
+ "NORTHWEST",
25
+ "SOUTHEAST",
26
+ "SOUTHWEST"
27
+ ]);
28
+ /**
29
+ * Checks whether a string is a valid international or local cellphone number.
30
+ *
31
+ * @param value - Input phone string.
32
+ * @param options - Validation options.
33
+ * @param options.allowInternational - Allows a leading `+`.
34
+ * @param options.minDigits - Minimum number of digits.
35
+ * @param options.maxDigits - Maximum number of digits.
36
+ * @returns `true` when the input matches configured constraints.
37
+ */
38
+ function isCellphoneNumber(value, options = {}) {
39
+ const allowInternational = options.allowInternational ?? true;
40
+ const minDigits = options.minDigits ?? 7;
41
+ const maxDigits = options.maxDigits ?? 15;
42
+ const normalized = value.trim().replace(/[\s().-]/g, "");
43
+ const pattern = allowInternational ? /^\+?\d+$/ : /^\d+$/;
44
+ if (!pattern.test(normalized)) {
45
+ return false;
46
+ }
47
+ const digits = normalized.startsWith("+") ? normalized.slice(1) : normalized;
48
+ return digits.length >= minDigits && digits.length <= maxDigits;
49
+ }
50
+ /**
51
+ * Validates common cardinal and intercardinal address directions.
52
+ *
53
+ * @param value - Direction text.
54
+ * @returns `true` when the input matches known direction tokens.
55
+ */
56
+ function isAddressDirection(value) {
57
+ return ADDRESS_DIRECTIONS.has(value.trim().toUpperCase());
58
+ }
59
+ /**
60
+ * Validates names using practical rules for most user forms.
61
+ *
62
+ * @param value - Name string.
63
+ * @param options - Validation options.
64
+ * @param options.minLength - Minimum total length.
65
+ * @param options.maxLength - Maximum total length.
66
+ * @returns `true` when the name is considered valid.
67
+ */
68
+ function isValidName(value, options = {}) {
69
+ const minLength = options.minLength ?? 2;
70
+ const maxLength = options.maxLength ?? 80;
71
+ const normalized = value.trim();
72
+ if (normalized.length < minLength || normalized.length > maxLength) {
73
+ return false;
74
+ }
75
+ return /^[A-Za-zÀ-ÖØ-öø-ÿ' -]+$/.test(normalized);
76
+ }
77
+ /**
78
+ * Validates an email using practical constraints for application forms.
79
+ *
80
+ * @param value - Email string.
81
+ * @returns `true` when email shape is valid.
82
+ */
83
+ function isEmail(value) {
84
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value.trim());
85
+ }
86
+ /**
87
+ * Validates an HTTP(S) URL.
88
+ *
89
+ * @param value - URL string.
90
+ * @returns `true` when URL is valid and protocol is HTTP or HTTPS.
91
+ */
92
+ function isHttpUrl(value) {
93
+ try {
94
+ const parsed = new URL(value.trim());
95
+ return parsed.protocol === "http:" || parsed.protocol === "https:";
96
+ }
97
+ catch {
98
+ return false;
99
+ }
100
+ }
101
+ /**
102
+ * Validates US-style postal codes (`12345` or `12345-6789`).
103
+ *
104
+ * @param value - Postal code string.
105
+ * @returns `true` when value matches supported postal formats.
106
+ */
107
+ function isPostalCode(value) {
108
+ return /^\d{5}(?:-\d{4})?$/.test(value.trim());
109
+ }
110
+ /**
111
+ * Validates password strength with common security requirements.
112
+ *
113
+ * @param value - Password candidate.
114
+ * @param options - Validation options.
115
+ * @param options.minLength - Minimum required length.
116
+ * @returns `true` when password meets complexity requirements.
117
+ */
118
+ function isStrongPassword(value, options = {}) {
119
+ const minLength = options.minLength ?? 8;
120
+ if (value.length < minLength) {
121
+ return false;
122
+ }
123
+ const hasUpper = /[A-Z]/.test(value);
124
+ const hasLower = /[a-z]/.test(value);
125
+ const hasDigit = /\d/.test(value);
126
+ const hasSymbol = /[^A-Za-z0-9]/.test(value);
127
+ return hasUpper && hasLower && hasDigit && hasSymbol;
128
+ }
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AA6BA,8CAiBC;AAQD,gDAEC;AAWD,kCAaC;AAQD,0BAEC;AAQD,8BAOC;AAQD,oCAEC;AAUD,4CAYC;AAzID,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAC/B,KAAa,EACb,UAAoF,EAAE;IAEtF,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,IAAI,CAAC;IAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAE1C,MAAM,UAAU,GAAG,KAAK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GAKG;AACH,SAAgB,SAAS,CAAC,KAAa;IACrC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACrC,OAAO,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,KAAa,EAAE,UAAkC,EAAE;IAClF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE7C,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,SAAS,CAAC;AACvD,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Checks whether a string is a valid international or local cellphone number.
3
+ *
4
+ * @param value - Input phone string.
5
+ * @param options - Validation options.
6
+ * @param options.allowInternational - Allows a leading `+`.
7
+ * @param options.minDigits - Minimum number of digits.
8
+ * @param options.maxDigits - Maximum number of digits.
9
+ * @returns `true` when the input matches configured constraints.
10
+ */
11
+ export declare function isCellphoneNumber(value: string, options?: {
12
+ allowInternational?: boolean;
13
+ minDigits?: number;
14
+ maxDigits?: number;
15
+ }): boolean;
16
+ /**
17
+ * Validates common cardinal and intercardinal address directions.
18
+ *
19
+ * @param value - Direction text.
20
+ * @returns `true` when the input matches known direction tokens.
21
+ */
22
+ export declare function isAddressDirection(value: string): boolean;
23
+ /**
24
+ * Validates names using practical rules for most user forms.
25
+ *
26
+ * @param value - Name string.
27
+ * @param options - Validation options.
28
+ * @param options.minLength - Minimum total length.
29
+ * @param options.maxLength - Maximum total length.
30
+ * @returns `true` when the name is considered valid.
31
+ */
32
+ export declare function isValidName(value: string, options?: {
33
+ minLength?: number;
34
+ maxLength?: number;
35
+ }): boolean;
36
+ /**
37
+ * Validates an email using practical constraints for application forms.
38
+ *
39
+ * @param value - Email string.
40
+ * @returns `true` when email shape is valid.
41
+ */
42
+ export declare function isEmail(value: string): boolean;
43
+ /**
44
+ * Validates an HTTP(S) URL.
45
+ *
46
+ * @param value - URL string.
47
+ * @returns `true` when URL is valid and protocol is HTTP or HTTPS.
48
+ */
49
+ export declare function isHttpUrl(value: string): boolean;
50
+ /**
51
+ * Validates US-style postal codes (`12345` or `12345-6789`).
52
+ *
53
+ * @param value - Postal code string.
54
+ * @returns `true` when value matches supported postal formats.
55
+ */
56
+ export declare function isPostalCode(value: string): boolean;
57
+ /**
58
+ * Validates password strength with common security requirements.
59
+ *
60
+ * @param value - Password candidate.
61
+ * @param options - Validation options.
62
+ * @param options.minLength - Minimum required length.
63
+ * @returns `true` when password meets complexity requirements.
64
+ */
65
+ export declare function isStrongPassword(value: string, options?: {
66
+ minLength?: number;
67
+ }): boolean;
@@ -0,0 +1,120 @@
1
+ const ADDRESS_DIRECTIONS = new Set([
2
+ "N",
3
+ "S",
4
+ "E",
5
+ "W",
6
+ "NE",
7
+ "NW",
8
+ "SE",
9
+ "SW",
10
+ "NORTH",
11
+ "SOUTH",
12
+ "EAST",
13
+ "WEST",
14
+ "NORTHEAST",
15
+ "NORTHWEST",
16
+ "SOUTHEAST",
17
+ "SOUTHWEST"
18
+ ]);
19
+ /**
20
+ * Checks whether a string is a valid international or local cellphone number.
21
+ *
22
+ * @param value - Input phone string.
23
+ * @param options - Validation options.
24
+ * @param options.allowInternational - Allows a leading `+`.
25
+ * @param options.minDigits - Minimum number of digits.
26
+ * @param options.maxDigits - Maximum number of digits.
27
+ * @returns `true` when the input matches configured constraints.
28
+ */
29
+ export function isCellphoneNumber(value, options = {}) {
30
+ const allowInternational = options.allowInternational ?? true;
31
+ const minDigits = options.minDigits ?? 7;
32
+ const maxDigits = options.maxDigits ?? 15;
33
+ const normalized = value.trim().replace(/[\s().-]/g, "");
34
+ const pattern = allowInternational ? /^\+?\d+$/ : /^\d+$/;
35
+ if (!pattern.test(normalized)) {
36
+ return false;
37
+ }
38
+ const digits = normalized.startsWith("+") ? normalized.slice(1) : normalized;
39
+ return digits.length >= minDigits && digits.length <= maxDigits;
40
+ }
41
+ /**
42
+ * Validates common cardinal and intercardinal address directions.
43
+ *
44
+ * @param value - Direction text.
45
+ * @returns `true` when the input matches known direction tokens.
46
+ */
47
+ export function isAddressDirection(value) {
48
+ return ADDRESS_DIRECTIONS.has(value.trim().toUpperCase());
49
+ }
50
+ /**
51
+ * Validates names using practical rules for most user forms.
52
+ *
53
+ * @param value - Name string.
54
+ * @param options - Validation options.
55
+ * @param options.minLength - Minimum total length.
56
+ * @param options.maxLength - Maximum total length.
57
+ * @returns `true` when the name is considered valid.
58
+ */
59
+ export function isValidName(value, options = {}) {
60
+ const minLength = options.minLength ?? 2;
61
+ const maxLength = options.maxLength ?? 80;
62
+ const normalized = value.trim();
63
+ if (normalized.length < minLength || normalized.length > maxLength) {
64
+ return false;
65
+ }
66
+ return /^[A-Za-zÀ-ÖØ-öø-ÿ' -]+$/.test(normalized);
67
+ }
68
+ /**
69
+ * Validates an email using practical constraints for application forms.
70
+ *
71
+ * @param value - Email string.
72
+ * @returns `true` when email shape is valid.
73
+ */
74
+ export function isEmail(value) {
75
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value.trim());
76
+ }
77
+ /**
78
+ * Validates an HTTP(S) URL.
79
+ *
80
+ * @param value - URL string.
81
+ * @returns `true` when URL is valid and protocol is HTTP or HTTPS.
82
+ */
83
+ export function isHttpUrl(value) {
84
+ try {
85
+ const parsed = new URL(value.trim());
86
+ return parsed.protocol === "http:" || parsed.protocol === "https:";
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ /**
93
+ * Validates US-style postal codes (`12345` or `12345-6789`).
94
+ *
95
+ * @param value - Postal code string.
96
+ * @returns `true` when value matches supported postal formats.
97
+ */
98
+ export function isPostalCode(value) {
99
+ return /^\d{5}(?:-\d{4})?$/.test(value.trim());
100
+ }
101
+ /**
102
+ * Validates password strength with common security requirements.
103
+ *
104
+ * @param value - Password candidate.
105
+ * @param options - Validation options.
106
+ * @param options.minLength - Minimum required length.
107
+ * @returns `true` when password meets complexity requirements.
108
+ */
109
+ export function isStrongPassword(value, options = {}) {
110
+ const minLength = options.minLength ?? 8;
111
+ if (value.length < minLength) {
112
+ return false;
113
+ }
114
+ const hasUpper = /[A-Z]/.test(value);
115
+ const hasLower = /[a-z]/.test(value);
116
+ const hasDigit = /\d/.test(value);
117
+ const hasSymbol = /[^A-Za-z0-9]/.test(value);
118
+ return hasUpper && hasLower && hasDigit && hasSymbol;
119
+ }
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH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,IAAI,QAAQ,IAAI,QAAQ,IAAI,SAAS,CAAC;AACvD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@jdsalasc/solvejs-validators",
3
+ "version": "1.0.2",
4
+ "description": "Practical validators for real JS/TS form pain points: cellphone, direction, name, password, email, and URL.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/cjs/index.cjs",
9
+ "module": "./dist/esm/index.js",
10
+ "types": "./dist/esm/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/esm/index.d.ts",
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.cjs"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "npm run clean && npm run build:esm && npm run build:cjs",
24
+ "build:esm": "tsc -p tsconfig.esm.json",
25
+ "build:cjs": "tsc -p tsconfig.cjs.json && node ./scripts/rename-cjs.mjs",
26
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
27
+ "test": "npm run build && node --test test/*.test.mjs",
28
+ "lint": "node -e \"console.log('No lint configured for @jdsalasc/solvejs-validators')\""
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "author": "jdsalasc",
34
+ "homepage": "https://github.com/jdsalasca/solvejs#readme",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/jdsalasca/solvejs.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/jdsalasca/solvejs/issues"
41
+ },
42
+ "engines": {
43
+ "node": ">=18"
44
+ },
45
+ "keywords": [
46
+ "validators",
47
+ "cellphone validator",
48
+ "name validator",
49
+ "password validator",
50
+ "solvejs"
51
+ ]
52
+ }