HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/cli-ux/lib/action/simple.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("./base");
class SimpleAction extends base_1.ActionBase {
    constructor() {
        super(...arguments);
        this.type = 'simple';
    }
    _start() {
        const task = this.task;
        if (!task)
            return;
        this._render(task.action, task.status);
    }
    _pause(icon) {
        if (icon)
            this._updateStatus(icon);
        else
            this._flush();
    }
    // eslint-disable-next-line @typescript-eslint/no-empty-function
    _resume() { }
    _updateStatus(status, prevStatus, newline = false) {
        const task = this.task;
        if (!task)
            return;
        if (task.active && !prevStatus)
            this._write(this.std, ` ${status}`);
        else
            this._write(this.std, `${task.action}... ${status}`);
        if (newline || !prevStatus)
            this._flush();
    }
    _stop(status) {
        const task = this.task;
        if (!task)
            return;
        this._updateStatus(status, task.status, true);
    }
    _render(action, status) {
        const task = this.task;
        if (!task)
            return;
        if (task.active)
            this._flush();
        this._write(this.std, status ? `${action}... ${status}` : `${action}...`);
    }
    _flush() {
        this._write(this.std, '\n');
        this._flushStdout();
    }
}
exports.default = SimpleAction;