A lot of problems occur after the installation of the latest release.
TS2732: Cannot find module 'cuss/index.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.
3 | import { generatePasswordFromPattern } from "./passwordGenerator";
4 | import { unleet } from "@cityssm/unleet";
5 | import * as cussWordsObject from "cuss/index.json";
| ^^^^^^^^^^^^^^^^^
6 |
7 |
8 | /*
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:46:1
TS2322: Type 'null' is not assignable to type 'string[]'.
44 | });
45 |
46 | cussWordsUnfiltered = null;
| ^^^^^^^^^^^^^^^^^^^
47 |
48 |
49 | const _hasCussWord = (unleetedString: string) => {
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:90:39
TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
Type 'undefined' is not assignable to type 'number'.
88 | const generateOptions = Object.assign({}, defaultGenerateOptions, userGenerateOptions);
89 |
90 | generateOptions.minScore = Math.min(generateOptions.minScore, 4);
| ^^^^^^^^^^^^^^^^^^^^^^^^
91 |
92 | let passwordPattern = generateOptions.pattern;
93 |
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:96:37
TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
94 | // Shuffle the pattern if necessary
95 | if (generateOptions.doShufflePattern) {
96 | passwordPattern = shuffleString(passwordPattern);
| ^^^^^^^^^^^^^^^
97 | }
98 |
99 | let retries = generateOptions.retries;
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:102:10
TS2532: Object is possibly 'undefined'.
100 |
101 | // Loop through retries
102 | while (retries > 0) {
| ^^^^^^^
103 |
104 | const potentialPassword = generatePasswordFromPattern(passwordPattern);
105 |
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:104:59
TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
102 | while (retries > 0) {
103 |
104 | const potentialPassword = generatePasswordFromPattern(passwordPattern);
| ^^^^^^^^^^^^^^^
105 |
106 | // Check length, check for potential cuss words
107 | if (potentialPassword.length >= generateOptions.minLength &&
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:107:37
TS2532: Object is possibly 'undefined'.
105 |
106 | // Check length, check for potential cuss words
107 | if (potentialPassword.length >= generateOptions.minLength &&
| ^^^^^^^^^^^^^^^^^^^^^^^^^
108 | potentialPassword.length <= generateOptions.maxLength &&
109 | zxcvbn(potentialPassword).score >= generateOptions.minScore &&
110 | !hasCussWord(potentialPassword)) {
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:108:35
TS2532: Object is possibly 'undefined'.
106 | // Check length, check for potential cuss words
107 | if (potentialPassword.length >= generateOptions.minLength &&
108 | potentialPassword.length <= generateOptions.maxLength &&
| ^^^^^^^^^^^^^^^^^^^^^^^^^
109 | zxcvbn(potentialPassword).score >= generateOptions.minScore &&
110 | !hasCussWord(potentialPassword)) {
111 |
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:109:7
TS2349: This expression is not callable.
Type '{ default: (password: string, userInputs?: string[] | undefined) => ZXCVBNResult; }' has no call signatures.
107 | if (potentialPassword.length >= generateOptions.minLength &&
108 | potentialPassword.length <= generateOptions.maxLength &&
109 | zxcvbn(potentialPassword).score >= generateOptions.minScore &&
| ^^^^^^
110 | !hasCussWord(potentialPassword)) {
111 |
112 | return potentialPassword;
ERROR in node_modules/@cityssm/simple-password-generator/index.ts:115:5
TS2532: Object is possibly 'undefined'.
113 | }
114 |
115 | retries -= 1;
| ^^^^^^^
116 | }
117 |
118 | return null;