"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const _ids_1 = require("../../../_ids");
class Pop extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['a'],
            o: ['a', 'last'],
        }, {}, system, _ids_1.ID_POP);
    }
    f({ a }, done) {
        if (a.length > 0) {
            const _a = [...a];
            const last = _a.pop();
            done({ a: _a, last });
        }
        else {
            done(undefined, 'cannot pop empty array');
        }
    }
}
exports.default = Pop;
//# sourceMappingURL=index.js.map