"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const _ids_1 = require("../../../_ids");
class MatchAll extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['str', 'regex'],
            o: ['matches'],
        }, {}, system, _ids_1.ID_MATCH_ALL);
    }
    f({ str, regex }, done) {
        const result = str.matchAll(new RegExp(regex, 'g'));
        const matches = [];
        for (const entry of result) {
            matches.push(entry.map((v) => v ?? ''));
        }
        done({ matches });
    }
}
exports.default = MatchAll;
//# sourceMappingURL=index.js.map