You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q:
when I use serialize like:
{
name: "aa",
attrname: "bb",
render(item, row) {
return JSON.parse(item) .map((it) => it.name).join("");
},
}
the regExp will catch this and cause problem, not when it's commented.
then I test the normal way like this:
{
name: "aa",
attrname: "bb",
render: (item, row) => {
return JSON.parse(item) .map((it) => it.name).join("");
},
}
source code :
var IS_PURE_FUNCTION = /function.?(/;
var IS_ARROW_FUNCTION = /.?=>.*?/;
// pure functions, example: {key: function() {}}
if(IS_PURE_FUNCTION.test(serializedFn)) {
return serializedFn;
}
// arrow functions, example: arg1 => arg1+5
if(IS_ARROW_FUNCTION.test(serializedFn)) {
return serializedFn;
}
Q:
when I use serialize like:
{
name: "aa",
attrname: "bb",
render(item, row) {
return JSON.parse(item) .map((it) => it.name).join("");
},
}
the regExp will catch this and cause problem, not when it's commented.
then I test the normal way like this:
{
name: "aa",
attrname: "bb",
render: (item, row) => {
return JSON.parse(item) .map((it) => it.name).join("");
},
}
and:
{
name: "aa",
attrname: "bb",
render: function(item, row) {
return JSON.parse(item) .map((it) => it.name).join("");
},
}
without the regExps, these are also correct.
could you please explain me?
The text was updated successfully, but these errors were encountered: