aboutsummaryrefslogtreecommitdiff
path: root/src/extensions/Extensions_String.ts
blob: c95095f8ed4f42fffaedc98bafc6d193def32c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* eslint-disable no-extend-native */
function Assign() {
    String.prototype.removeTrailingNewlines = function () {
        let sliced = this;
        while (sliced.endsWith('\n')) {
            sliced = sliced.substring(0, this.length - 1);
        }
        return sliced as string;
    };

    String.prototype.hasNewline = function () {
        return this.endsWith('\n');
    };
}

export { Assign };