Closed lupeaserban closed 1 year ago
Hi,
Sorry for the delay responding.
function intToString(item) {
return {
intVariable: item.intVariable.toString(),
...item,
};
}
will just return the item as it is. You probably want:
function intToString(item) {
return {
...item,
intVariable: item.intVariable.toString(),
};
}
so the intVariable
field is set to the string.
Also, you are not passing the transform. You are executing it.
const Opts = {
fields: [ {}, {} ], // i have some selection enabled here that works fine
transforms: [ intToString ] // without the parentheses
}
If you wan to use the parentheses you just need to use the closure. The reason it didn't show up before is because what I said before about your transform beign wrong 🙂
I have my transform function like so:
then i have my transforms array and parser next:
The file is .ts and the error says:
I also tried with a closure to clear the error and adapted my function to this:
However the transformation isn't happening.
Any help or lead is appreciated. Thanks.