-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Tempate type added - 'inline' | 'popup', Default 'popup'
2. Now only able to pass options using [NgPasswordValidator] to minimize complexity. 3. Performance optimizations
- Loading branch information
Jagan Mohan Bishoyi
committed
Jul 9, 2022
1 parent
45ccee8
commit ea442b1
Showing
10 changed files
with
107 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { NgPasswordValidatorOptions } from './ng-password-validator.interface'; | ||
|
||
@Injectable() | ||
export class UtilsService { | ||
/** | ||
* Deep merge objects | ||
* | ||
* @param {NgPasswordValidatorOptions} target | ||
* @param {NgPasswordValidatorOptions} source | ||
* @returns {NgPasswordValidatorOptions} | ||
* @memberof UtilsService | ||
*/ | ||
deepMerge( | ||
target: NgPasswordValidatorOptions, | ||
source: NgPasswordValidatorOptions | ||
): NgPasswordValidatorOptions { | ||
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties | ||
for (const key of Object.keys(source)) { | ||
if (source[key] instanceof Object) { | ||
Object.assign(source[key], this.deepMerge(target[key], source[key])); | ||
} | ||
} | ||
|
||
// Join `target` and modified `source` | ||
Object.assign(target || {}, source); | ||
|
||
return target; | ||
} | ||
} |