Skip to content

Commit

Permalink
fix(api): Refactor password validation directory structure
Browse files Browse the repository at this point in the history
This commit deletes the existing 'main.ts' file and creates a new one within the 'api' directory. Additionally, it renames and moves some files from the 'api/standard' directory to the 'validator' directory. Changes to package.json and various import file paths support these modifications. The rearrangement enhances code organization and improves navigability.
  • Loading branch information
Theshedman committed Nov 28, 2023
1 parent 479e2a2 commit 1f3c1ab
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "0.0.0-semantic-release",
"description": "Robust regex-free, dependency-free password validation library.",
"type": "module",
"main": "./dist/cjs/src/password/main.js",
"module": "./dist/esm/src/password/main.js",
"types": "./dist/types/src/password/main.d.ts",
"main": "./dist/cjs/src/password/api/main.js",
"module": "./dist/esm/src/password/api/main.js",
"types": "./dist/types/src/password/api/main.d.ts",
"exports": {
"types": "./dist/types/src/password/main.d.ts",
"import": "./dist/esm/src/password/main.js",
"require": "./dist/cjs/src/password/main.js"
"types": "./dist/types/src/password/api/main.d.ts",
"import": "./dist/esm/src/password/api/main.js",
"require": "./dist/cjs/src/password/api/main.js"
},
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
Expand Down
2 changes: 1 addition & 1 deletion src/password/api/fluent/FluentPasswordValidator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DigitValidator } from "../../validator/DigitValidator.js";
import { ValidatorManager } from "../standard/ValidatorManager.js";
import { ValidatorManager } from "../../validator/ValidatorManager.js";
import { ValidationResult } from "../../validator/ValidationResult.js";
import { PasswordValidator } from "../../validator/PasswordValidator.js";
import { UpperCaseValidator } from "../../validator/UpperCaseValidator.js";
Expand Down
15 changes: 15 additions & 0 deletions src/password/api/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export * from "../validator/Util.js";
export * from "../validator/Validator.js";
export * from "../validator/DigitValidator.js";
export * from "../validator/ValidationResult.js";
export * from "../validator/ValidatorManager.js";
export * from "../validator/ValidatorCategory.js";
export * from "../validator/PasswordValidator.js";
export * from "../validator/LowerCaseValidator.js";
export * from "../validator/MaxLengthValidator.js";
export * from "../validator/UpperCaseValidator.js";
export * from "../validator/MinLengthValidator.js";
export * from "./standard/PasswordValidatorManager.js";
export * from "../validator/NoSpaceCharacterValidator.js";
export * from "../validator/SpecialCharacterValidator.js";
export * from "../validator/PasswordValidatorConflictException.js";
4 changes: 2 additions & 2 deletions src/password/api/standard/PasswordValidatorManager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ValidatorManager } from "./ValidatorManager.js";
import { ValidatorManager } from "../../validator/ValidatorManager.js";
import { ValidationResult } from "../../validator/ValidationResult.js";
import { PasswordValidator } from "../../validator/PasswordValidator.js";
import { PasswordValidatorConflictException } from "./PasswordValidatorConflictException.js";
import { FluentPasswordValidator } from "../fluent/FluentPasswordValidator.js";
import { PasswordValidatorConflictException } from "../../validator/PasswordValidatorConflictException.js";

export class PasswordValidatorManager implements ValidatorManager {
private readonly registeredValidators: Array<PasswordValidator> = Array.of();
Expand Down
15 changes: 0 additions & 15 deletions src/password/main.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Validator } from "../../validator/Validator.js";
import { PasswordValidator } from "../../validator/PasswordValidator.js";
import { Validator } from "./Validator.js";
import { PasswordValidator } from "./PasswordValidator.js";

export interface ValidatorManager extends Validator {
register(...validators: Array<PasswordValidator>): void;
Expand Down

1 comment on commit 1f3c1ab

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.3% 144/148
🟢 Branches 92.31% 36/39
🟢 Functions 100% 59/59
🟢 Lines 97.24% 141/145

Test suite run success

63 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 1f3c1ab

Please sign in to comment.