• Creates an escaped path which is suitable for use in RegExp construction.

    Note: This function will throw if a malformed URL string is the target. In AbstractPluginManager this function is used after the module has been loaded / is a good target.

    Parameters

    • target: string | URL

      Target full / relative path or URL to escape.

    Returns string

    The escaped target.