Implementation of String Prototype to natively Format itself content

Implements the String prototype to be able, natively, to manipulate parameters based on text interpolation.

Hi, folks.
I believe that an implementation like this can make so much more easily to manipulate raw strings without make use of external libraries and standardize the way to make it.

Before:

N/A

After:
Index-based, Named-based and Mix-based (Single-replace)

'%0 that is too damn high. Again, %1!'.format ('Hi, Planet');
'%hiplanet that is too damn high. Again, %hiplanet!'.format ('Hi, Planet');
'%something that is too damn high. Again, %458!'.format ('Hi, Planet');

Order Desired Index-based

'%999, %000 that is too damn high. Again, %999, %000!'.format (['Hi', 'Planet']);
'%hi, %planet that is too damn high. Again, %hi, %planet!'.format (['Hi', 'Planet']);
'%some, %thing that is too damn high. Again, %some, %thing!'.format (['Hi', 'Planet']);

Object keys-based

'%hi, %planet that is too damn high. Again, %hi, %planet!'.format ({ hi: 'Hi', planet: 'Planet' });

Multiple objects keys-based

'%hi, %planet that is too damn high. Again, %hi, %planet!'.format ([{ hi: 'Hi' }, { planet: 'Planet' }]);

All above snnipets will returns

// Hi, Planet that is too damn high. Again, Hi, Planet!

It will help the others and deserves the official implementation?

I made it. I just propose this topic to consider the implementation officially.
Follow the code:

/**
 * @description Formats the string itself with parameters
 * @param { string | number | Array <string> | Array <number> | object } toReplace 
 * @version 3.0 - Added named parameters
 * @todo This code is acessible to ES5. To better readability and performance/standards, implements Arrow functions and replace the lines: 31, 32 and 33 by 34;
 */
String.prototype.format = function (toReplace) {
    
    // The text itself
    var str = this.toString ();
    // Variable that will contains the interpolation found inside text
    var toFind = '';
    
    // Checks if there is something passed as a parameter
    if (toReplace && toReplace.length) {

        // Checks if the parameter passed is a string or a number
        // Single Interpolation     : console.log ('%hiplanet that is too damn high. Again, %hiplanet!'.format ('Hi, Planet'));
        // Multiple Interpolation   : console.log ('%0 that is too damn high. Again, %1!'.format ('Hi, Planet'));
        // Multiple Named-Index Interpolation   : console.log ('%something that is too damn high. Again, %458!'.format ('Hi, Planet'));
        if (typeof toReplace == 'string' || typeof element == 'number') {
            
            // Maps all possible interpolation replacements
            toFind = str.match (/([%])([a-z]|[0-9])+/g);
            
            // Replaces all occurencies of interpolation replacements by the single informed parameter
            toFind.forEach (function (elem) {
                str = str.toString ().split (elem).join (toReplace);
            });
            // ES6 - str = toFind ? toFind.reduce (function (acc, val){ return acc.split (val).join (toReplace); }, str) : str;
        }

        // Checks if the parameter is an array
        else if (Array.isArray (toReplace)) {

            // Iterates over each array element
            toReplace.forEach (function (element) {

                // Checks if the array element passed is a string or a number
                // console.log ('%hi, %planet that is too damn high. Again, %hi, %planet!'.format (['Hi', 'Planet']));
                if (typeof element == 'string' || typeof element == 'number') {
                    
                    // Finds all first equals interpolation replacements to replace them
                    toFind = str.match (/([%])([a-z]|[0-9])+/)[0];
                    str = toFind ? str.split (toFind).join (String (element)) : str;
                }
                else {
                    // Checks an array of object as parameters
                    // console.log ('%hi, %planet that is too damn high. Again, %hi, %planet!'.format ([{ hi: 'Hi' }, { planet: 'Planet' }]));
                    Object.keys (element).forEach (function (elem) {
                        toFind = str.match (new RegExp ('(%)('+ elem + ')', 'g'))[0];
                        str = toFind ? str.split (toFind).join (String (element [elem])) : str;
                    });
                }
            });
        }
    }
    // Checks if the parameter is an object
    // console.log ('%hi, %planet that is too damn high. Again, %hi, %planet!'.format ({ hi: 'Hi', planet: 'Planet' }));
    else if (typeof toReplace == 'object') {

        // Iterates over each key inside the object
        Object.keys (toReplace).forEach (function (elem) {
            toFind = str.match (new RegExp ('(%)('+ elem + ')', 'g'))[0];
            str = toFind ? str.split ('%' + elem).join (String (toReplace [elem])) : str;
        });
    }
    return str;
};