passlens 1.1.1 → 1.1.4
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 +1 -1
- package/package.json +16 -7
- package/src/checker.ts +0 -52
- package/src/index.ts +0 -3
- package/src/types.ts +0 -8
- package/tsconfig.json +0 -46
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passlens",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "A TypeScript password strength analyzer",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"readme": "README.md",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
7
12
|
"scripts": {
|
|
8
13
|
"dev": "tsx watch src/index.ts",
|
|
9
14
|
"build": "tsc",
|
|
10
15
|
"start": "node dist/index.js"
|
|
11
16
|
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
"keywords": [
|
|
18
|
+
"password",
|
|
19
|
+
"security",
|
|
20
|
+
"strength",
|
|
21
|
+
"validator"
|
|
22
|
+
],
|
|
23
|
+
"author": "Arham Kabir",
|
|
24
|
+
"license": "MIT",
|
|
15
25
|
"type": "module",
|
|
16
26
|
"dependencies": {
|
|
17
27
|
"dotenv": "^17.4.2"
|
|
18
28
|
},
|
|
19
29
|
"devDependencies": {
|
|
20
|
-
"@types/express": "^5.0.6",
|
|
21
30
|
"@types/node": "^26.1.1",
|
|
22
31
|
"tsx": "^4.23.1",
|
|
23
32
|
"typescript": "^7.0.2"
|
package/src/checker.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { PasswordResult } from "./types.js";
|
|
2
|
-
|
|
3
|
-
const checkPassword = (password: string): PasswordResult => {
|
|
4
|
-
let score = 0;
|
|
5
|
-
const issues: string[] = [];
|
|
6
|
-
|
|
7
|
-
if (password.length >= 8) {
|
|
8
|
-
score++;
|
|
9
|
-
} else {
|
|
10
|
-
issues.push("Password should be at least 8 characters");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (/[A-Z]/.test(password)) {
|
|
14
|
-
score++;
|
|
15
|
-
} else {
|
|
16
|
-
issues.push("Add uppercase letters");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (/[a-z]/.test(password)) {
|
|
20
|
-
score++;
|
|
21
|
-
} else {
|
|
22
|
-
issues.push("Add lowercase letters");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (/[0-9]/.test(password)) {
|
|
26
|
-
score++;
|
|
27
|
-
} else {
|
|
28
|
-
issues.push("Add numbers");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (/[^A-Za-z0-9]/.test(password)) {
|
|
32
|
-
score++;
|
|
33
|
-
} else {
|
|
34
|
-
issues.push("Add special characters");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let strength: "weak" | "medium" | "strong" | "very-strong";
|
|
38
|
-
|
|
39
|
-
if (score <= 2) {
|
|
40
|
-
strength = "weak";
|
|
41
|
-
} else if (score <= 3) {
|
|
42
|
-
strength = "medium";
|
|
43
|
-
} else if (score <= 4) {
|
|
44
|
-
strength = "strong";
|
|
45
|
-
} else {
|
|
46
|
-
strength = "very-strong";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return { score, strength, valid: score >= 4, issues };
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default checkPassword;
|
package/src/index.ts
DELETED
package/src/types.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
// "rootDir": "./src",
|
|
6
|
-
// "outDir": "./dist",
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"rootDir": "./src",
|
|
9
|
-
|
|
10
|
-
// Environment Settings
|
|
11
|
-
// See also https://aka.ms/tsconfig/module
|
|
12
|
-
"module": "nodenext",
|
|
13
|
-
"target": "esnext",
|
|
14
|
-
"types": [],
|
|
15
|
-
// For nodejs:
|
|
16
|
-
// "lib": ["esnext"],
|
|
17
|
-
// "types": ["node"],
|
|
18
|
-
// and npm install -D @types/node
|
|
19
|
-
|
|
20
|
-
// Other Outputs
|
|
21
|
-
"sourceMap": true,
|
|
22
|
-
"declaration": true,
|
|
23
|
-
"declarationMap": true,
|
|
24
|
-
|
|
25
|
-
// Stricter Typechecking Options
|
|
26
|
-
"noUncheckedIndexedAccess": true,
|
|
27
|
-
"exactOptionalPropertyTypes": true,
|
|
28
|
-
|
|
29
|
-
// Style Options
|
|
30
|
-
// "noImplicitReturns": true,
|
|
31
|
-
// "noImplicitOverride": true,
|
|
32
|
-
// "noUnusedLocals": true,
|
|
33
|
-
// "noUnusedParameters": true,
|
|
34
|
-
// "noFallthroughCasesInSwitch": true,
|
|
35
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
36
|
-
|
|
37
|
-
// Recommended Options
|
|
38
|
-
"strict": true,
|
|
39
|
-
"jsx": "react-jsx",
|
|
40
|
-
"verbatimModuleSyntax": true,
|
|
41
|
-
"isolatedModules": true,
|
|
42
|
-
"noUncheckedSideEffectImports": true,
|
|
43
|
-
"moduleDetection": "force",
|
|
44
|
-
"skipLibCheck": true
|
|
45
|
-
}
|
|
46
|
-
}
|