You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
600 B
25 lines
600 B
6 years ago
|
import {LinkType} from '@ui/type';
|
||
|
|
||
|
export function getDrivers(linkSelected: LinkType): {text: string; value: string}[] {
|
||
|
const drivers: {text: string; value: string}[] = [];
|
||
6 years ago
|
if (linkSelected.drivers && linkSelected.drivers.length > 0) {
|
||
6 years ago
|
linkSelected.drivers.forEach(item => {
|
||
|
drivers.push({
|
||
|
text: item,
|
||
|
value: item,
|
||
|
});
|
||
|
});
|
||
|
} else {
|
||
|
drivers.push({
|
||
|
text: linkSelected.driver,
|
||
|
value: linkSelected.driver,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
return drivers;
|
||
|
}
|
||
6 years ago
|
|
||
|
export function connectNameChecker(name: string): boolean {
|
||
|
return /^\+?[1-9][0-9]*$/.test(name);
|
||
|
}
|