0

Currently I am able to parse data as objects, But the object looks like:

{ CallTime: '0', Color_MachineState: 'ManualStop', StartDate: '2021/1/7 19:03', MachineName: 'CDK10' }

Now, What I want is, the properties should be in their original types.

{ CallTime: 0, Color_MachineState: 'ManualStop', StartDate: Thu Jan 07 2021 19:03:00 GMT+0530 (India Standard Time), MachineName: 'CD10' }

For a moment, considering Date have many formats, We can skip date fields to be dealt specifically, but other fields like integers, real numbers should be in their original type.

I have an option to iterate over object properties with a wrapper function over JSON.parse() to handle failures, but I'm expecting something better, and faster as I'll be dealing with thousands of records.

New contributor
Vinayak Kuradia is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

Vinayak Kuradia is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.