_register_route() {
        // The first argument will always be the method (in lowercase)
        const method = arguments[0];

        // The pattern, options and handler must be dynamically parsed depending on the arguments provided and router behavior
        let pattern, options, handler;

        // Iterate through the remaining arguments to find the above values and also build an Array of middleware / handler callbacks
        // The route handler will be the last one in the array
        const callbacks = [];
        for (let i = 1; i < arguments.length; i++) {
            const argument = arguments[i];

            // The second argument should be the pattern. If it is a string, it is the pattern. If it is anything else and we do not have a context pattern, throw an error as that means we have no pattern.
            if (i === 1) {
                if (typeof argument === 'string') {
                    if (this.#context_pattern) {
                        // merge the provided pattern with the context pattern
                        pattern = merge_relative_paths(this.#context_pattern, argument);
                    } else {
                        // The path is as is
                        pattern = argument;
                    }

                    // Continue to the next argument as this is not the pattern but we have a context pattern
                    continue;
                } else if (!this.#context_pattern) {
                    throw new Error(
                        'HyperExpress.Router: Route pattern is required unless created from a chainable route instance using Route.route() method.'
                    );
                } else {
                    // The path is the context pattern
                    pattern = this.#context_pattern;
                }
            }

            // Look for options, middlewares and handler in the remaining arguments
            if (typeof argument == 'function') {
                // Scenario: Single function
                callbacks.push(argument);
            } else if (Array.isArray(argument)) {
                // Scenario: Array of functions
                callbacks.push(...argument);
            } else if (argument && typeof argument == 'object') {
                // Scenario: Route options object
                options = argument;
            }
        }

        // Write the route handler and route options object with fallback to the default options
        handler = callbacks.pop();
        options = {
            streaming: {},
            middlewares: [],
            ...(options || {}),
        };

        // Make a shallow copy of the options object to avoid mutating the original
        options = Object.assign({}, options);

        // Enforce a leading slash on the pattern if it begins with a catchall star
        // This is because uWebsockets.js does not treat non-leading slashes as catchall stars
        if (pattern.startsWith('*')) pattern = '/' + pattern;

        // Parse the middlewares into a new array to prevent mutating the original
        const middlewares = [];

        // Push all the options provided middlewares into the middlewares array
        if (Array.isArray(options.middlewares)) middlewares.push(...options.middlewares);

        // Push all the callback provided middlewares into the middlewares array
        if (callbacks.length > 0) middlewares.push(...callbacks);

        // Write the middlewares into the options object
        options.middlewares = middlewares;

        // Initialize the record object which will hold information about this route
        const record = {
            method,
            pattern,
            options,
            handler,
        };

        // Store record for future subscribers
        this.#records.routes.push(record);

        // Create route if this is a Server extended Router instance (ROOT)
        if (this.#is_app) return this._create_route(record);

        // Alert all subscribers of the new route that was created
        this.#subscribers.forEach((subscriber) => subscriber('route', record));

        // Return this to make the Router chainable
        return this;
    }
Registers a route in the routes array for this router.

@private
@param {String} method Supported: any, get, post, delete, head, options, patch, put, trace
@param {String} pattern Example: "/api/v1"
@param {Object} options Route processor options (Optional)
@param {Function} handler Example: (request, response) => {}
@returns {this} Chainable instance