/*jshint node: true */

module.exports = {

    /**
     * Returns true if and only if the string value of the first argument
     * ends with the given suffix. Otherwise, returns false. Does NOT support
     * the length argument.
     *
     * Normally, one would just use String.prototype.endsWith, but since there
     * are Node versions out there which don't support ES6 yet, this function
     * exists. It either wraps the native method, or alternatively performs
     * the check manually.
     */
    endsWith: function (str, suffix) {

        var subject = str.toString();
        if (typeof subject.endsWith === "function")
            return subject.endsWith(suffix);

        return subject.substr(-suffix.length) === suffix;

    }

};

@@ -676,16 +676,69 @@
 ffix);%0A%0A
+        if (suffix === %22%22)%0A            return true;%0A%0A
         
@@ -757,13 +757,12 @@
 ct.s
-ubstr
+lice
 (-su

Fix .endsWith() not matching empty string on 0.10