"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cucumber_1 = require("@cucumber/cucumber");
const json_compare_1 = require("../runtime/json-compare");
(0, cucumber_1.Then)('the JSON file {string} should match {string} using key {string}', async function (actualPath, expectedPath, keyColumn) {
    await (0, json_compare_1.compareJsonRowsFromFiles)({
        actualPath,
        expectedPath,
        keyColumns: splitKeys(keyColumn),
        mode: 'exact'
    });
});
(0, cucumber_1.Then)('the JSON file {string} should match {string} using keys {string}', async function (actualPath, expectedPath, keyColumns) {
    await (0, json_compare_1.compareJsonRowsFromFiles)({
        actualPath,
        expectedPath,
        keyColumns: splitKeys(keyColumns),
        mode: 'exact'
    });
});
(0, cucumber_1.Then)('the JSON file {string} should contain rows from {string} using key {string}', async function (actualPath, expectedPath, keyColumn) {
    await (0, json_compare_1.compareJsonRowsFromFiles)({
        actualPath,
        expectedPath,
        keyColumns: splitKeys(keyColumn),
        mode: 'contains'
    });
});
(0, cucumber_1.Then)('the JSON file {string} should contain rows from {string} using keys {string}', async function (actualPath, expectedPath, keyColumns) {
    await (0, json_compare_1.compareJsonRowsFromFiles)({
        actualPath,
        expectedPath,
        keyColumns: splitKeys(keyColumns),
        mode: 'contains'
    });
});
function splitKeys(value) {
    return value.split(',').map((part) => part.trim()).filter(Boolean);
}
