Skip to content

[Feature Request] Higher order uneval functionΒ #88

@RebeccaStevens

Description

@RebeccaStevens

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions