{"size": 571, "ext": "js", "max_stars_repo_path": "JavaScript/M03_JavaScriptAdvanced/L08_Classes/Exercises/P05_LengthLimit/LengthLimit.js", "max_stars_repo_name": "todorkrastev/softuni-software-engineering", "max_stars_repo_stars_event_min_datetime": "2021-04-06T21:35:50.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-07T09:51:58.000Z", "max_issues_repo_path": "JavaScript/M03_JavaScriptAdvanced/L08_Classes/Exercises/P05_LengthLimit/LengthLimit.js", "max_issues_repo_name": "todorkrastev/softuni-software-engineering", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "JavaScript/M03_JavaScriptAdvanced/L08_Classes/Exercises/P05_LengthLimit/LengthLimit.js", "max_forks_repo_name": "todorkrastev/softuni-software-engineering", "max_forks_repo_forks_event_min_datetime": "2022-02-23T13:03:14.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-23T13:03:14.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.84, "max_line_length": 71, "alphanum_fraction": 0.5551663748}
class Stringer {
    constructor(string, length) {
        this.innerString = string;
        this.innerLength = length;
    }

    increase(value) {
        this.innerLength += value;
    }
    decrease(value) {
        const result = this.innerLength - value;
        this.innerLength = result < 0 ? 0 : result;
    }

    toString() {
        if (this.innerLength === 0) return '...';

        if (this.innerString.length > this.innerLength) {
            return `${this.innerString.slice(0, this.innerLength)}...`;
        }

        return this.innerString;
    }
}
