I have 125k test cases and it takes 1 min and 30 secs before I could get the result. Is there any option to optimize my mapping? Thank you..
const getEachValueByLine = () => {
if (IsJsonString(multipleValue)) {
setInvalidFormat(true)
isValidRegex ? setValidRegex(true) : setValidRegex(false)
const parseValue = Object.entries(JSON.parse(multipleValue))
const addId = parseValue.map((item, index) => ({ id: index, case: item[0], expected: item[1] }))
handleMultiValidate(addId)
} else {
setInvalidFormat(false)
}
}
The problem starts in here:
const parseValue = Object.entries(JSON.parse(multipleValue))
const addId = parseValue.map((item, index) => ({ id: index, case: item[0], expected: item[1] }))