export class WhitelistFilter {
    name = 'whitelist';
    stage;
    allow;
    constructor(stage, allow) {
        this.stage = stage;
        this.allow = new Set(allow || []);
    }
    apply(input) {
        if (!input || typeof input !== 'object')
            return { ok: true, data: input };
        const out = {};
        for (const k of Object.keys(input)) {
            if (this.allow.has(k))
                out[k] = input[k];
        }
        return { ok: true, data: out };
    }
}
