current(name, params) {
        const { name: current, params: currentParams, query, route } = this._unresolve();

        // If a name wasn't passed, return the name of the current route
        if (!name) return current;

        // Test the passed name against the current route, matching some
        // basic wildcards, e.g. passing `events.*` matches `events.show`
        const match = new RegExp(`^${name.replace(/\./g, '\\.').replace(/\*/g, '.*')}$`).test(
            current,
        );

        if ([null, undefined].includes(params) || !match) return match;

        const routeObject = new Route(current, route, this._config);

        params = this._parse(params, routeObject);
        const routeParams = { ...currentParams, ...query };

        // If the current window URL has no route parameters, and the passed parameters are empty, return true
        if (
            Object.values(params).every((p) => !p) &&
            !Object.values(routeParams).some((v) => v !== undefined)
        )
            return true;

        const isSubset = (subset, full) => {
            return Object.entries(subset).every(([key, value]) => {
                if (Array.isArray(value) && Array.isArray(full[key])) {
                    return value.every((v) => full[key].includes(v));
                }

                if (
                    typeof value === 'object' &&
                    typeof full[key] === 'object' &&
                    value !== null &&
                    full[key] !== null
                ) {
                    return isSubset(value, full[key]);
                }

                return full[key] == value;
            });
        };

        // Check that all passed parameters match their values in the current window URL
        // Use weak equality because all values in the current window URL will be strings
        return isSubset(params, routeParams);
    }
Get the name of the route matching the current window URL, or, given a route name
and parameters, check if the current window URL and parameters match that route.

@example
// at URL https://ziggy.dev/posts/4 with 'posts.show' route 'posts/{post}'
route().current(); // 'posts.show'
route().current('posts.index'); // false
route().current('posts.show'); // true
route().current('posts.show', { post: 1 }); // false
route().current('posts.show', { post: 4 }); // true

@param {String} [name] - Route name to check.
@param {(String|Number|Array|Object)} [params] - Route parameters.
@return {(Boolean|String|undefined)}