Add console.log for _staffLDB (Transformed data)

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-08-07 11:27:44 +01:00
parent 0673637fa3
commit ae1a467c97
2 changed files with 1 additions and 5 deletions

View File

@ -71,6 +71,7 @@ async function arrDepBoardStaff(CRS) {
try { try {
const _staffLdb = staffStationTransform(result) const _staffLdb = staffStationTransform(result)
console.log("Transformation Test Successful") console.log("Transformation Test Successful")
console.log(JSON.stringify(_staffLdb))
} catch (err) { } catch (err) {
console.log("Transformation Test Failed: " + err) console.log("Transformation Test Failed: " + err)
} }

View File

@ -29,12 +29,10 @@ export function transform(input: any): StaffLdb | null {
} }
function transformDateTime(input: string): Date { function transformDateTime(input: string): Date {
console.debug(`staffStation.transformDateTime Input: ${input}`)
return new Date(input) return new Date(input)
} }
function transformNrcc(input: any): NrccMessage[] { function transformNrcc(input: any): NrccMessage[] {
console.debug(`staffStations.transformNrcc: Running`)
let output: NrccMessage[] = [] let output: NrccMessage[] = []
let messages = input let messages = input
if (!Array.isArray(input?.message)) { if (!Array.isArray(input?.message)) {
@ -51,7 +49,6 @@ function transformNrcc(input: any): NrccMessage[] {
} }
function transformTrainServices(input: any): TrainServices[] { function transformTrainServices(input: any): TrainServices[] {
console.debug(`staffStation.transformTrainServices running`)
let services: any = input?.service let services: any = input?.service
let output: TrainServices[] = [] let output: TrainServices[] = []
if (services === undefined) { if (services === undefined) {
@ -91,7 +88,6 @@ function transformTrainServices(input: any): TrainServices[] {
} }
function transformLocation(input: any): ServiceLocation[] { function transformLocation(input: any): ServiceLocation[] {
console.debug(`staffStation.transformLocation running`)
let output: ServiceLocation[] = [] let output: ServiceLocation[] = []
let locations: any[] = input.location let locations: any[] = input.location
if (!Array.isArray(input.location)) { if (!Array.isArray(input.location)) {
@ -124,7 +120,6 @@ export function calculateLength(input: any): number | undefined {
} }
function transformUnspecifiedDateTime(input: string): Date | undefined { function transformUnspecifiedDateTime(input: string): Date | undefined {
console.debug(`staffStation.transformUnspecifiedDateTime running`)
if (!input) { if (!input) {
return undefined return undefined
} }