@carecard/validate 1.0.1 → 2.0.1
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/coverage/clover.xml +139 -0
- package/coverage/coverage-final.json +4 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/index.ts.html +91 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/validate.ts.html +559 -0
- package/coverage/lcov-report/validateProperties.ts.html +370 -0
- package/coverage/lcov.info +378 -0
- package/index.js +4 -0
- package/lib/validate.js +190 -0
- package/lib/validateProperties.js +106 -0
- package/package.json +14 -40
- package/readme.md +22 -4
package/package.json
CHANGED
|
@@ -1,49 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carecard/validate",
|
|
3
|
-
"version": "
|
|
4
|
-
"private": false,
|
|
5
|
-
"description": "Validate functions",
|
|
6
|
-
"license": "ISC",
|
|
7
|
-
"author": "PK Singh",
|
|
3
|
+
"version": "2.0.1",
|
|
8
4
|
"repository": {
|
|
9
5
|
"type": "git",
|
|
10
|
-
"url": "git+https
|
|
11
|
-
},
|
|
12
|
-
"type": "module",
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
6
|
+
"url": "git+https://github.com/CareCard-ca/pkg-validate.git"
|
|
15
7
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"types": "./dist/esm/index.d.ts",
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"import": "./dist/esm/index.js",
|
|
22
|
-
"require": "./dist/cjs/index.cjs",
|
|
23
|
-
"types": "./dist/esm/index.d.ts"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
8
|
+
"description": "Validate data",
|
|
9
|
+
"main": "index.js",
|
|
29
10
|
"scripts": {
|
|
30
|
-
"
|
|
31
|
-
"build:esm": "tsc -p tsconfig.esm.json",
|
|
32
|
-
"build:cjs": "tsc -p tsconfig.cjs.json && node ./scripts/rename-cjs.js",
|
|
33
|
-
"test": "NODE_NO_WARNINGS=1 jest --coverage",
|
|
34
|
-
"format": "prettier --write .",
|
|
35
|
-
"format:check": "prettier --check .",
|
|
36
|
-
"lint": "eslint",
|
|
37
|
-
"prepare": "husky"
|
|
11
|
+
"test": "export NODE_ENV=test && mocha --watch --recursive"
|
|
38
12
|
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"validate",
|
|
15
|
+
"data"
|
|
16
|
+
],
|
|
17
|
+
"author": "CareCard team",
|
|
18
|
+
"license": "ISC",
|
|
39
19
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"typescript": "5.9.3",
|
|
44
|
-
"typescript-eslint": "8.50.1",
|
|
45
|
-
"prettier": "3.7.4",
|
|
46
|
-
"eslint": "9.39.2",
|
|
47
|
-
"husky": "9.1.7"
|
|
48
|
-
}
|
|
20
|
+
"mocha": "11.7.5"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {}
|
|
49
23
|
}
|
package/readme.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Validate
|
|
2
|
+
### Functions
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
It works with js or ts and commonjs and esm.
|
|
4
|
+
All functions return boolean value, false on failure
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
- Validates that a string is string of characters
|
|
7
|
+
```js
|
|
8
|
+
isStringOfCharacters(str)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- Validates that a string is fit for username
|
|
12
|
+
```js
|
|
13
|
+
isStringOfUsername(str)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Validates that string is an email
|
|
17
|
+
```js
|
|
18
|
+
isEmail(email)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- Validates that string is fit for password
|
|
22
|
+
```js
|
|
23
|
+
isStringOfPassword(password)
|
|
24
|
+
```
|