newStaffLDB-API #48

Merged
fred.boniface merged 85 commits from newStaffLDB-API into main 2023-10-03 21:35:03 +01:00
Showing only changes of commit b61851e122 - Show all commits

View File

@ -34,10 +34,15 @@ export function transform(input: any): StaffLdb | null {
}
function transformDateTime(input: string): Date {
console.log("Transform Date Time Running")
return new Date(input);
}
function transformNrcc(input: any): NrccMessage[] | undefined {
console.log("Transform Nrcc Running")
if (input === undefined) {
return input
}
let output: NrccMessage[] = [];
let messages = input;
if (!Array.isArray(input?.message)) {
@ -57,6 +62,7 @@ function transformNrcc(input: any): NrccMessage[] | undefined {
}
function transformTrainServices(input: any): TrainServices[] {
console.log("Transform Train Services Running")
let services: any = input?.service;
let output: TrainServices[] = [];
if (services === undefined) {
@ -98,6 +104,7 @@ function transformTrainServices(input: any): TrainServices[] {
}
function transformLocation(input: any): ServiceLocation[] {
console.log("Transform Location Running")
let output: ServiceLocation[] = [];
let locations: any[] = input.location;
if (!Array.isArray(input.location)) {
@ -116,6 +123,7 @@ function transformLocation(input: any): ServiceLocation[] {
}
export function calculateLength(input: any): number | undefined {
console.log("Calculate Length Running")
let length: number;
if (input?.length) {
length = input.length;
@ -129,6 +137,7 @@ export function calculateLength(input: any): number | undefined {
}
function transformUnspecifiedDateTime(input: string): Date | undefined {
console.log("Transform Unspecified Date Time Running")
if (!input) {
return undefined;
}