fix(tech): Replaced replaceAll methods with replace to avoid errors in some older browsers.
Squashed commit of the following: commit 559c099720500a5fa55d92456cc555ab5d980e1f Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Oct 14 13:14:16 2021 +0200 Replaced replaceAll with replace method with regex to avoid older browser-problems
This commit is contained in:
@@ -9,7 +9,7 @@ export function mapPathsToBreadcrumbs(
|
||||
let breadcrumbs = [
|
||||
...(startBreadcrumb ? [startBreadcrumb] : []),
|
||||
...paths.map((path, index) => ({
|
||||
text: mapPathToPageName(path),
|
||||
text: mapPathToPageName(path).replace(/-/g, ' '),
|
||||
routerLink: `/${paths.slice(0, index + 1).join('/')}`,
|
||||
})),
|
||||
];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const CURRENT_YEAR = new Date().getFullYear().toString().slice(2, 4);
|
||||
|
||||
export function mapStringToSsn(ssn: string): string {
|
||||
ssn = ssn.replaceAll('-', '');
|
||||
ssn = (ssn || '').replace(/-/g, '');
|
||||
if (ssn.length === 10) {
|
||||
const century = +CURRENT_YEAR - +ssn.slice(0, 2) > 0 ? '20' : '19';
|
||||
ssn = ssn.padStart(12, century);
|
||||
|
||||
@@ -25,7 +25,7 @@ export function CommaSeparatedEmailValidator(): ValidatorFn {
|
||||
if (control && control.value) {
|
||||
const values: string[] = (control.value as string)
|
||||
.toLowerCase()
|
||||
.replaceAll(/\n|\t|\r/g, '')
|
||||
.replace(/\n|\t|\r/g, '')
|
||||
.split(/[\s,;:]+/);
|
||||
const invalidEmailaddresses = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user