Skip to content

Add option to apply all environment-specific compatibility #32

@slevithan

Description

@slevithan

Add an option to apply compatibility fixes even if they’re not needed by the current environment. This would be useful when serializing transpiled patterns for later use.

Context

Oniguruma-To-ES 3.1.1 added an environment-specific workaround (#30) to handle a WebKit bug that was reported in Shiki. The workaround is applied only when the environment that Oniguruma-To-ES is running in has the bug. That means if you serialize output in an environment that doesn't include the bug and then construct an affected regex in an environment that does, the regex won't work correctly.

Proposed solution

Add an option to toRegExp/toRegExpDetails called e.g. includeAllEnvFixes that applies all environment-specific workarounds during transpilation, even if they aren't needed in the current environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions