"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const _ids_1 = require("../../../_ids");
class Behead extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['a'],
            o: ['a', 'head'],
        }, {}, system, _ids_1.ID_BEHEAD);
    }
    f({ a }, done) {
        if (!a.length) {
            done(undefined, 'cannot behead empty array');
            return;
        }
        const _a = [...a];
        const head = _a.shift();
        done({ a: _a, head });
    }
}
exports.default = Behead;
//# sourceMappingURL=index.js.map