-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
I would like to be able to set up uneval
before executing it. That way I can reference that same configured function with the replacer.
Example
const myUneval = uneval((value) => {
if (isFoo(value)) {
return `Foo(${myUneval(value)})`;
}
});
const result = myUneval(input)
Workaround
I can use a named function as the replacer as a workaround, but this requires needing to pass it a as a parameter in each subsequent uneval call.
const result = uneval(input, function myReplacer() {
if (isFoo(value)) {
return `Foo(${uneval(value, myReplacer)})`;
}
})
As there is this workaround, this request isn't all that important, but it would be a nice to have in my opionion.
FlorianFlatscher
Metadata
Metadata
Assignees
Labels
No labels