"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeCanonicalEntryForComparison = normalizeCanonicalEntryForComparison;
exports.normalizeIgnoreEntryForComparison = normalizeIgnoreEntryForComparison;
exports.collectNormalizedIgnoreEntries = collectNormalizedIgnoreEntries;
function normalizeCanonicalEntryForComparison(entry) {
    const trimmed = entry.trim();
    if (trimmed.endsWith("/")) {
        return trimmed.slice(0, -1);
    }
    return trimmed;
}
function normalizeIgnoreEntryForComparison(line) {
    const trimmed = line.trim();
    if (trimmed === "" || trimmed.startsWith("#") || trimmed.startsWith("!")) {
        return null;
    }
    if (trimmed.endsWith("/")) {
        return trimmed.slice(0, -1);
    }
    return trimmed;
}
function collectNormalizedIgnoreEntries(lines) {
    return new Set(lines
        .map((line) => normalizeIgnoreEntryForComparison(line))
        .filter((line) => line !== null));
}
