"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ListUnique = void 0;
const fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify"));
const __1 = require("..");
class ListUnique extends __1.Pipe {
    async apply(inputList) {
        const set = new Set();
        return await this.map(inputList, async (el) => {
            const val = el.objectId + '|' + (0, fast_json_stable_stringify_1.default)(el.value ?? null);
            if (set.has(val)) {
                return null;
            }
            set.add(val);
            return el;
        });
    }
}
exports.ListUnique = ListUnique;
ListUnique.$type = 'List.unique';
//# sourceMappingURL=List.unique.js.map