mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files. Criteria for ownership: * Files used by a single team, is now owned by that team. * Files related to a domain owned by a team is now owned by that team. * Where ownership is unclear the "lowest level" service takes ownership.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { AbstractControl, AsyncValidatorFn, ValidationErrors } from "@angular/forms";
|
||||
|
||||
export function notAllowedValueAsync(
|
||||
valueGetter: () => Promise<string>,
|
||||
caseInsensitive = false
|
||||
): AsyncValidatorFn {
|
||||
return async (control: AbstractControl): Promise<ValidationErrors | null> => {
|
||||
let notAllowedValue = await valueGetter();
|
||||
let controlValue = control.value;
|
||||
if (caseInsensitive) {
|
||||
notAllowedValue = notAllowedValue.toLowerCase();
|
||||
controlValue = controlValue.toLowerCase();
|
||||
}
|
||||
|
||||
if (controlValue === notAllowedValue) {
|
||||
return {
|
||||
notAllowedValue: true,
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user