Skip to content

Make re2 optional #11

@JamieMagee

Description

@JamieMagee

Right now re2 is always imported. Regardless of if it's used or not:

const RE2 = require('re2');

re2 is precompiled and not available for all architectures. node-docker-reference should attempt to load it, but fall back to RegExp if re2 is not available. For example, here's how it's handled in Renovate:

https://github.com/renovatebot/renovate/blob/48af4012e6d0b4d90a9aeb4df1471f452b677cd8/lib/util/regex.ts#L11-L20

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