"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.add = add;
exports.remove = remove;
exports.default = default_1;
const uniqid_1 = __importDefault(require("./utils/uniqid"));
const transformations = [];
function add(f) {
    const id = (0, uniqid_1.default)();
    transformations.push({ id, f });
    return id;
}
function remove(id) {
    const i = transformations.findIndex(t => t.id == id);
    if (i >= 0) {
        transformations.splice(i, 1);
    }
}
function default_1(files) {
    return transformations.reduce((files, { f }) => f(files), files);
}
